Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Automatically fill in current date in a Table

Status
Not open for further replies.

chica3578

Technical User
Oct 9, 2003
7
US
Hello,

I have a table with multiple columns and the information needs to be verified manually line by line. I've added 2 columns "Verification" (Yes/No Data Type) and "Verification Date" (Date data type).

Is it possible that when I check "Yes" in the Verification column, the Current Date will automatically fill in the Verification Date column by default? If I haven't checked anything, I want the Date column blank.

I will really appreciate your help! Thank you!
 
Without seeing more I can't give specific instructions.
You want the date loaded into the table. I'm assuming you have a form bound to the table...

In an After Update event on the Verification control, you can check to see if the user selected yes. If so, you can just:
Me.[Verification Date] = Date()

And, if the user changes his/her mind and has checked no, or left Verification blank, you can:
Me.[Verification Date] = Null
or
Me.[Verification Date] = ""

depending on whether you want the date field to have a null value, or (recommended) a zero length string.


HTH,
Bob
Your mileage may vary, but following the guidelines in faq181-2886 will help you reach your goal.
 
Bob,
I don't have form bound to the table. I am directly going into the table to make my changes and updates. Therefore, when I check 'Yes' in the Verification column, I need the "VerificationDate" column to automatically fill with today's date.

Thanks!!!

-r-
 
-r-

Can't do that at the table level because the logic doesn't exist. You can speed up things a bit after you've typed the date once. To duplicate that date once you're on the next row in the same field, just hold down your Control key and press the apostrophe. Voila!

If others are doing the keying, it might be better to set up a form, and then you could plug the date per my previous post.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top