I am designing a form in which the user will enter beginning and ending dates. I will use these dates in a macro to create an sql SELECT string. Unfortunately, I have been unable to determine how to access the data entered in the date field from my macro. My best guess at the code is:
Sub DateTest
DIM oForm as OBJECT
DIM oStartBox as OBJECT 'This is a date field on oForm
DIM dDate as DATE
oForm = ThisComponent.Drawpage.Forms.getByName("sqlForm")
oStartBox= oForm.getByName("StartBox")
dDate = oStartBox.getCurrentValue()
msgbox dDate
end sub
“StartBox” is a date field located on the “sqlForm”. I execute the macro using a push button on the form after entering a date in the date field.
I get the error message:
BASIC runtime error.
Incorrect property value.
This seems like it should be a very simple operation, and it probably is, but I am missing something.