Event Procedure to lookup value in table and perform action based onvalue

  • Thread starter Thread starter steve
  • Start date Start date
S

steve

I have a table called dates that has only one row and one column with
one date value. I want to write an event procedure on the Open Event
of a form that looks the value in the dates table and, if the current
date is greater than the value in the table, the form would close.

I am not sure what code or commands to use since I'm not that familiar
with writing Event Procedures.

Any help would be appreciated.

Steve
 
steve said:
I have a table called dates that has only one row and one column with
one date value. I want to write an event procedure on the Open Event
of a form that looks the value in the dates table and, if the current
date is greater than the value in the table, the form would close.

I am not sure what code or commands to use since I'm not that familiar
with writing Event Procedures.

Any help would be appreciated.

Steve

Date is a reserved word in Access so if you're using it as a field name I'd
recommend changing it to something like fldDate. Check out the DLookup
function in the help, that should do what you want in the form's Open event.

Keith.
www.keithwilby.co.uk
 
Steve

If you want to compare to the current date/time value, use the Now()
function Larry mentioned.

If you want to compare to only the current date portion, use the Date()
function.

Regards

Jeff Boyce
Microsoft Office/Access MVP

Larry Daugherty said:
Compare [DLookup() the value in that table and field] with Now().

HTH
--
-Larry-
--

steve said:
I have a table called dates that has only one row and one column with
one date value. I want to write an event procedure on the Open Event
of a form that looks the value in the dates table and, if the current
date is greater than the value in the table, the form would close.

I am not sure what code or commands to use since I'm not that familiar
with writing Event Procedures.

Any help would be appreciated.

Steve
 
Back
Top