I have a timed form that opens when my db loads. When the form closes a query is run that pulls time sensitive records from a customer table.
I am trying to set up another function on my form that takes the system date from a text box on my form(already made) and compares it to a field in a query I have set up. If the fields match it should run report containing all of the fields where the dates match.
My code is similar to this...
Private Sub Form_Load()
If frmWelcome("txtDATE") = qry30_DAY_ALERT("30_DAY") Then
DoCmd.OpenReport "Report Name"
End If
End Sub
***frmWelcome = loading form
txtDATE = text box that displays the system date
qry30_DAY_ALERT("30_DAY") = query and field that contains the date a customer should be contacted.
Its simple, but I keep getting different errors. Can someone help me or make a suggestion on a better way to set this up.
Thanks in Advance
I am trying to set up another function on my form that takes the system date from a text box on my form(already made) and compares it to a field in a query I have set up. If the fields match it should run report containing all of the fields where the dates match.
My code is similar to this...
Private Sub Form_Load()
If frmWelcome("txtDATE") = qry30_DAY_ALERT("30_DAY") Then
DoCmd.OpenReport "Report Name"
End If
End Sub
***frmWelcome = loading form
txtDATE = text box that displays the system date
qry30_DAY_ALERT("30_DAY") = query and field that contains the date a customer should be contacted.
Its simple, but I keep getting different errors. Can someone help me or make a suggestion on a better way to set this up.
Thanks in Advance