Not sure if this should go here, or the Query forum, or the VBA forum, so... let me know if I'm in the wrong place.
I have a form, put a button on it, and clicking the button runs a query. The query asks me for a date. I want to have Me.Date somehow make it into the named query. Not sure how to do that?
Here's my code:
Thank you for your help!
Thanks!!
Matt
I have a form, put a button on it, and clicking the button runs a query. The query asks me for a date. I want to have Me.Date somehow make it into the named query. Not sure how to do that?
Here's my code:
Code:
Private Sub cmdAddToSelected_Click()
On Error GoTo Err_cmdAddToSelected_Click
'Runs the update query to update a table based on the information
'shown in the current form
DoCmd.DoMenuItem acFormBar, acRecordsMenu, 5, , acMenuVer70
DoCmd.SetWarnings False
DoCmd.OpenQuery "qudEventReSelect", acNormal, acEdit 'This is the query that needs a date from the user, me
DoCmd.OpenForm "frmServiceList" 'This form will display the records that got updated
DoCmd.Close acForm, "frmEvents", acSaveNo 'This is the name of the form where the button is located
DoCmd.SetWarnings True
Exit_cmdAddToSelected_Click:
Exit Sub
Err_cmdAddToSelected_Click:
MsgBox Err.Description
Resume Exit_cmdAddToSelected_Click
End Sub
Thank you for your help!
Thanks!!
Matt