Ask Your Question

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

asked 2014-10-10 12:33:46 +0100

PChitnis gravatar image

updated 2014-10-10 12:34:34 +0100

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.

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by Alex Kemp
close date 2016-03-04 20:28:44.102618

2 Answers

Sort by » oldest newest most voted

answered 2014-10-10 18:10:05 +0100

JPL gravatar image

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.


edit flag offensive delete link more

answered 2014-10-12 16:16:26 +0100

PChitnis gravatar image

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.

edit flag offensive delete link more


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 gravatar imageJPL ( 2014-10-12 19:17:09 +0100 )edit

Question Tools

1 follower


Asked: 2014-10-10 12:33:46 +0100

Seen: 2,474 times

Last updated: Oct 12 '14