C
Chuck216
Hi
I have a menu form “frmAviatorSemiAnnualMenu´with a text box “Text14†and a
command button on it to open a form, the code behind the button is.
Private Sub cmdJanThruJune_Click()
On Error GoTo Err_Command0_Click
Dim stDocName As String
Dim stLinkCriteria As String
Me.Text14 = ">= DateSerial(Year(Date()), 1, 1) AND <
DateSerial(Year(Date()), 7, )"
stDocName = "frmAviatorSemiAnnual"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_Command0_Click:
Exit Sub
Err_Command0_Click:
MsgBox Err.Description
Resume Exit_Command0_Click
End Sub
The form is based on a query with the following code in the criteria for
InspDate.
Like [Forms]![frmAviatorSemiAnnualMenu]![Text14]
The problem is when I click the cmd button I get no results at all. If I put
the following into the criteria of InspDate it works fine.
Thanks in advance for any help with this.
Chuck
I have a menu form “frmAviatorSemiAnnualMenu´with a text box “Text14†and a
command button on it to open a form, the code behind the button is.
Private Sub cmdJanThruJune_Click()
On Error GoTo Err_Command0_Click
Dim stDocName As String
Dim stLinkCriteria As String
Me.Text14 = ">= DateSerial(Year(Date()), 1, 1) AND <
DateSerial(Year(Date()), 7, )"
stDocName = "frmAviatorSemiAnnual"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_Command0_Click:
Exit Sub
Err_Command0_Click:
MsgBox Err.Description
Resume Exit_Command0_Click
End Sub
The form is based on a query with the following code in the criteria for
InspDate.
Like [Forms]![frmAviatorSemiAnnualMenu]![Text14]
The problem is when I click the cmd button I get no results at all. If I put
the following into the criteria of InspDate it works fine.
= DateSerial(Year(Date()), 1, 1) AND < DateSerial(Year(Date()), 7, )
Thanks in advance for any help with this.
Chuck