set a variable with data from a table.

M

Mike

Hi,
i have a table with cloumns Dates, Te001, Te002, Te003 etc.....
In the dates column is a list of future dates. In the other columns are tick
boxes set to on or off.

I want a command button on a form to use part of the code to check whether a
specific box is ticked or not for a certain date.
I then want furhter code to follow depending on the result.
I decided to use a variable called DateTakenTrueFalse to contin this value
which can only be true or false (1 or 0)

I tried a DoCmd.runSQL ("SELECT Te003 FROM tblDates WHERE Dates = #" &
DateTakenTest & "#")= DateTakenTrueFalse

but this didn't work.

Any help would come highly appreciated.
Many thanks for your time.
 
K

Ken Snell [MVP]

Use the DLookup function to get a value of a single record from a table or
query:

DateTakenTrueFalse = DLookup("Te003", "tblDates", "Dates = #" &
DateTakenTest & "#")
 
M

Mike

I also need the date format to be the UK version with dd/mm/yy instead any
calculations assume american format mm/dd/yy which will prove very difficult
in later programming.

Thanks in advance
 
B

Bourdugephilippe

Hi

I guess it is possible to do easely but i don't really understand what you
want. to do on your form.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top