I am trying to add records to a browse that do not have matching records yet from a form.
When I press the button to open the browse, I get the error "no records in query". If there are records matching, it will open and I can add more records to the browse.
How can I open the browse with that error? In other words, when there are no records yet.
I think we could add or delete a line in the following code to force it.
Is it possible?
When I press the button to open the browse, I get the error "no records in query". If there are records matching, it will open and I can add more records to the browse.
How can I open the browse with that error? In other words, when there are no records yet.
I think we could add or delete a line in the following code to force it.
Is it possible?
Code:
dim flag_error as l flag_error = .f. if is_object(topparent.this) then p = topparent.this if eval_valid("P:Id.value") then DELETE Parameter1 'Set the Parameter variable to the object's .value property Parameter1 = eval("P:Id.value") else flag_error = .t. end if else flag_error = .t. end if if flag_error then ui_msg_box("Error","Id does not exist. This script cannot be run in this context.",UI_STOP_SYMBOL) end end if filter = "idmatch = [varC->parameter1]" query.filter = replace_parameters(filter,local_variables()) query.order = "" 'Open the layout_type showing just the records that satisfy the filter DIM Shared varP_Rembrowse as P DIM layout_name as c layout_name = "Rembrowse" dim tempP as p 'Get pointer to existing window. In case layout_name is qualified with a dictionary name, extract up to first @. In case formname has spaces, normalize it tempP=obj(":"+object_name_normalize(word(layout_name,1,"@"))) 'Test if pointer is valid if is_object(tempP) then 'Test if pointer refers to a form or browse if tempP.class() = "form" .or. tempP.class() = "browse" then dim flagIsBaseFilter as l flagIsBaseQuery = .t. if flagIsBaseFilter then 'Apply the query to the form or browse as the Base query. (this means that 'the user cannot turn the query off, only add to the query) tempP.BaseQueryRun(query.filter,query.order) else tempP.QueryRun(query.filter,query.order) end if 'then activate the already open window tempP.activate() else 'Window is not already open, so open it varP_Rembrowse = :Browse.viewqueried(layout_name,query.filter, query.order ) end if else varP_Rembrowse = :Browse.viewqueried(layout_name,query.filter, query.order ) end if
Comment