I have a form that dislays payroll information, based on date. The form is based on a stored procedure that displays all records, sorted by date (which is a variable). In the Form Properties...Data...Input Parameters field I have this entered in:
@varDate datetime = Date()
This way only the current date's records will show by default. I want the user to be able to type in a new date in a text field, and then only have those records available to be viewed. So I put this code in:
Private Sub txtDate_AfterUpdate()
Me.InputParameters = CDate(Me!txtDate) 'problem location
Me.Requery
End Sub
I can't find the right syntax to make this work. I keep getting a "Error converting from nvarchar to datetime" message. The CDate is what was in the help file.
Any help will be appreciated!
@varDate datetime = Date()
This way only the current date's records will show by default. I want the user to be able to type in a new date in a text field, and then only have those records available to be viewed. So I put this code in:
Private Sub txtDate_AfterUpdate()
Me.InputParameters = CDate(Me!txtDate) 'problem location
Me.Requery
End Sub
I can't find the right syntax to make this work. I keep getting a "Error converting from nvarchar to datetime" message. The CDate is what was in the help file.
Any help will be appreciated!