I have this code and getting syntax error; Not sure what syntax for this.
Not sure whats the proper syntax for stLinkCriteria to filter form on date range.
On Error GoTo Err_Open_Click
If Dcount("*", "QryDateRecieved") = 0 Then
MsgBox "There are no records to display"
Me!EnterDate.SetFocus
Else
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "maintblBankruptcy"
[Forms]![maintblBankruptcy]!cmdfilter.Visible = True
Me.Visible = False
stLinkCriteria = Between("[DateRecieved]=" & "#" & Format$(Me![EnterDate], "yyyy-mm-dd") & "#" & "[DateRecieved]=" & "#" & Format$(Me![EndDate2], "yyyy-mm-dd") & "#")
DoCmd.OpenForm stDocName, , , stLinkCriteria
DoCmd.Close , "frmQueryrecieved"
End If
Exit_Open_Click:
Exit Sub
Err_Open_Click:
MsgBox Err.Description
Resume Exit_Open_Click
End Sub
Not sure whats the proper syntax for stLinkCriteria to filter form on date range.
On Error GoTo Err_Open_Click
If Dcount("*", "QryDateRecieved") = 0 Then
MsgBox "There are no records to display"
Me!EnterDate.SetFocus
Else
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "maintblBankruptcy"
[Forms]![maintblBankruptcy]!cmdfilter.Visible = True
Me.Visible = False
stLinkCriteria = Between("[DateRecieved]=" & "#" & Format$(Me![EnterDate], "yyyy-mm-dd") & "#" & "[DateRecieved]=" & "#" & Format$(Me![EndDate2], "yyyy-mm-dd") & "#")
DoCmd.OpenForm stDocName, , , stLinkCriteria
DoCmd.Close , "frmQueryrecieved"
End If
Exit_Open_Click:
Exit Sub
Err_Open_Click:
MsgBox Err.Description
Resume Exit_Open_Click
End Sub