How to read the value of a date field in a base form into macro?

I need to read the date entered into a base form date field, as a variable in a macro for using in a SQL command. I have been able to read numeric fields using GetCurrentValue but date field give an error. I have tried the snippets given in Access2Base library (value, getvalue etc) but to no avail.

If the Access2Base library is loaded, and if “myForm” and “myDate” are respectively the name of your form and the name of the date field in that form, then next code should do the job:

Dim dDate As Date
     dDate = Forms("myForm").Controls("myDate").Value

Note the use of a Basic field of type Date.

JPL

Thanks JPL. I am not sure if Access2Base library is correctly linked with my database AND I will keep at it till its done!
My “grouse” with LO is that Access2Base is not covered in the documentation. It took me 3 months to discover this resource! In the particular case I am using MySQL as back end and have (now) worked out procedures and functions therein to be called from the form to minimise scripting in basic! I am using a “Filter” table as suggested in base handbook. The initial saving of the choice in this file is used to pass data to procedures and functions in MySQL.

As you can read in the Basic IDE at the top of each Access2Base module, the documentation is available on here.

To initialize the library look in particular at this page.

My intent is once to transfer the Access2Base doc to the LO help wiki. However not before this wiki becomes the master version of all LO help pages, including the off-line help. Not the case yet.

JPL