I am trying to arrange a search on an embedded browse on a form. I want the browse to show the records that fall between two dates on the browse
I have a button that initiates an xdialog where the dates can be written or selected in the calendar on the field style.
I then try to use the variables to do a query on the table that the browse is based on. I suppose that this will then be reflected in the browse but
I haven't gotten that far yet.
I am trying to use the code I see in the help files on Between_Date() The code there seems to be pretty clear but when I run their code it gets stuck
on the line that creates the query. I always get an error message that says no such field exists so I guess I haven't declared the variables adequately?
can anyone show me how I can properly get this to work. I need to be able to locate a file on a browse that falls between two dates.
any insight would be greatly appreciated as I have never really figured out how I can use xdialog to do anything outside of the dialog. I can't really see how to get things in and out of a x-dialog. I have looked at the alpha Sports example but it deals with reports and what I am interested in is a browse in a form.
Thanks
below is the code I am trying to use what I get when I run this code is error message.png
I have a button that initiates an xdialog where the dates can be written or selected in the calendar on the field style.
I then try to use the variables to do a query on the table that the browse is based on. I suppose that this will then be reflected in the browse but
I haven't gotten that far yet.
I am trying to use the code I see in the help files on Between_Date() The code there seems to be pretty clear but when I run their code it gets stuck
on the line that creates the query. I always get an error message that says no such field exists so I guess I haven't declared the variables adequately?
can anyone show me how I can properly get this to work. I need to be able to locate a file on a browse that falls between two dates.
any insight would be greatly appreciated as I have never really figured out how I can use xdialog to do anything outside of the dialog. I can't really see how to get things in and out of a x-dialog. I have looked at the alpha Sports example but it deals with reports and what I am interested in is a browse in a form.
Thanks
below is the code I am trying to use what I get when I run this code is error message.png
Code:
'Date Created: 06-Mar-2014 05:35:57 PM 'Last Updated: 13-Mar-2014 07:27:21 AM 'Created By : Assistant 'Updated By : Assistant 'Create an XDialog dialog box to prompt for parameters. DIM Global VFirst_Date as D DIM Global VLast_Date as D DIM Global varC_result as C Dim t as P Dim i as P ok_button_label = "&OK" cancel_button_label = "&Cancel" varC_result = ui_dlg_box("Search Records For Dates in a Range",<<%dlg% {region} First Date in Range:| [%DATE;P=popup.calendar(dtoc(V_First_date));I=popup.calendar%.40V_First_date!V_First_date_*]; Last Date in Range:| [%DATE;P=popup.calendar(dtoc(VLast_Date));I=popup.calendar%.40VLast_Date!VLast_Date_*]; {endregion}; {line=1,0}; {region} <*15=ok_button_label!OK> <15=cancel_button_label!CANCEL> {endregion}; %dlg%,<<%code% if left(a_dlg_button,13) = "VFirst_Date_" then if a_dlg_button = "VFirst_Date_killfocus" then V_First_date = ctod(dtoc(VFirst_Date)) end if a_dlg_button = "" end if if left(a_dlg_button,11) = "VLast_Date_" then if a_dlg_button = "VLast_Date_killfocus" then VLast_Date = ctod(dtoc(VLast_Date)) end if a_dlg_button = "" end if %code%) t=table.open("discovery") query.filter=between_date("date",VFirst_Date,VLast_Date) i=t.query_create()
Comment