I posted this over in reports but I really needed to post it here.
What I am trying to accomplish is this: I need the user to input a date range, then pick a harvester from a list [HARV], and finally enter a decimal number which will be stored in [CHAPPXX] and used in a formula from the fruit/query table. Here is the code I have so far .. It only includes picking a harvester at this point because I cannot figure out how to incorporate that rest of the code.
Private Sub Command0_Click()
Dim strReport As String 'Name of report to open.
Dim strField As String 'Name of your date field.
Dim strWhere As String 'Where condition for OpenReport.
strReport = "Contractor's Weekly Summary Report"
strField = "HARV"
' Debug.Print strWhere 'For debugging purposes only.
If Not IsNull(Me.cboHARV) Then 'block combo box
strWhere = "[HARV] = """ & Me.cboHARV & """"
End If
DoCmd.OpenReport strReport, acViewPreview, , strWhere
Me.Visible = False
End Sub
I have used a date range before but when I add it to this code it just gives me syntax errors or compile errors. I need to name the strings something else or really I do not know what I need to do! I need help!!
Thank You
What I am trying to accomplish is this: I need the user to input a date range, then pick a harvester from a list [HARV], and finally enter a decimal number which will be stored in [CHAPPXX] and used in a formula from the fruit/query table. Here is the code I have so far .. It only includes picking a harvester at this point because I cannot figure out how to incorporate that rest of the code.
Private Sub Command0_Click()
Dim strReport As String 'Name of report to open.
Dim strField As String 'Name of your date field.
Dim strWhere As String 'Where condition for OpenReport.
strReport = "Contractor's Weekly Summary Report"
strField = "HARV"
' Debug.Print strWhere 'For debugging purposes only.
If Not IsNull(Me.cboHARV) Then 'block combo box
strWhere = "[HARV] = """ & Me.cboHARV & """"
End If
DoCmd.OpenReport strReport, acViewPreview, , strWhere
Me.Visible = False
End Sub
I have used a date range before but when I add it to this code it just gives me syntax errors or compile errors. I need to name the strings something else or really I do not know what I need to do! I need help!!
Thank You