How do I auto fill date field?

Noreene Patrick

Registered User.
Local time
Today, 12:09
Joined
Jul 18, 2002
Messages
223
I know this is a simple question but I just cant seem to get it right.
I have a form that is run by a query...the query filters out all records from the table that match the dayofweek I input..for instance, when form opens popup box asks what day? and I input Monday...all records with shipday monday appear in my form in datasheet view....

I want my date field in form to input the date on all records..my code that I entered says: on form load if Isnull(me.txtthisday.value) then
me.txtthisday.value = now() endif (I tried to put date() but my parenthesis always erased)

It puts the date on the first record, but I need every record to automatically have the date inserted when I open the form.

What am I doing wrong?
Thanks, Noreene
 
Noreene Patrick said:
(I tried to put date() but my parenthesis always erased)

That's okay. As the Date() function requires no arguments the VBA editor removes the brackets as they are deemed unnecessary.
 
Thank you SJMcAbney..I learn so much each time I come to this forum...

So, how do I get it to put date on each record that appears in my form (datasheet view)?

It only appears on first record and the empty record at bottom.
 
Last edited:
What about using an UPDATE Query to add the date to all records?
 
I cant seem to figure out how to make the update query work...Basically what I want it to do is

When I query out records to see in form, even if I do nothing at all to any record, I want it to append those records to tblHistory and put current date in date field (in tblHistory) when I close form.

Then I will run a query to delete data in certain fields so next week on the same day I will have a clean set of records to work with because certain data never changes.

Could I copy recordset or something?

Thanks, Noreene
 
Last edited:

Users who are viewing this thread

Back
Top Bottom