Solved Need Update Query to use a date from a form as the date? (1 Viewer)

Number11

Member
Local time
Today, 14:38
Joined
Jan 29, 2020
Messages
607
So i need to have an update query change a date for all records within a table, but it needs to use the date from a date Picker Form

I tried this but didn't work..

('Forms!Date_Picker.Date')
 

Gasman

Enthusiastic Amateur
Local time
Today, 14:38
Joined
Sep 21, 2011
Messages
14,053
Use the Query designer to get the correct syntax
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 22:38
Joined
May 7, 2009
Messages
19,175
add a a textbox (date).
add a button and on the click of the button, update the table.
 

Number11

Member
Local time
Today, 14:38
Joined
Jan 29, 2020
Messages
607
add a a textbox (date).
add a button and on the click of the button, update the table.
Thats what i have but the update query does not use the date within the Date_Picker form
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 22:38
Joined
May 7, 2009
Messages
19,175
what is the Criteria of your Update Query?
you edit the query. highlight your "form" criteria and copy it.

on the click event of the button:

private sub button_click()
docmd.setparameter "the critieria here", Format$(Me!date_picker,"\#mm\/dd\/yyyy\#")
docmd.openqury "yourUpdateQueryName"
end sub
 

Number11

Member
Local time
Today, 14:38
Joined
Jan 29, 2020
Messages
607
what is the Criteria of your Update Query?
you edit the query. highlight your "form" criteria and copy it.

on the click event of the button:

private sub button_click()
docmd.setparameter "the critieria here", Format$(Me!date_picker,"\#mm\/dd\/yyyy\#")
docmd.openqury "yourUpdateQueryName"
end sub
Ok done this but its still not entering the date the criteria is "If NULL"
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 22:38
Joined
May 7, 2009
Messages
19,175
the criteria is Directly below the date field:

Is Null
 

Users who are viewing this thread

Top Bottom