P
Peter Kinsman
Private Sub cmdDisplay_Click()
If txtBRANCH < "0" Or txtPROP < "0" Or txtLAND < "0" Or txtTENT < "0"
Then
MsgBox ("All Fields Must Be Input")
Exit Sub
Else
strWhere = ""
If IsDate(txtSDATE) Then strWhere = "Date >= #" & txtSDATE & "#"
' MsgBox (DCount("Date", "Deposit Display", strWhere) & " Records")
If DCount("Date", "Deposit Display", strWhere) > 0 Then
DoCmd.OpenForm "Deposit Display", , , strWhere
DoCmd.Maximize
Else
MsgBox ("No Records Selected")
End If
End If
End Sub
The above is an event procedure which is causing great consternation - using
Access97.
The text boxes are on the selection form, and are all text except txtSDATE
which is a search date.
I am using as a test two records, in 1993 and 1995. If I set the search
date to 01/01/1995, then the message box displays "1 Records" - which is
correct - but the form still displays both records even though the filter
property of the query that the form is linked to is set to Date >=
"#01/01/1995#". Does anyone know if the syntax for the WHERE clause should
be different in the two situations please?
Many thanks
Peter Kinsman
If txtBRANCH < "0" Or txtPROP < "0" Or txtLAND < "0" Or txtTENT < "0"
Then
MsgBox ("All Fields Must Be Input")
Exit Sub
Else
strWhere = ""
If IsDate(txtSDATE) Then strWhere = "Date >= #" & txtSDATE & "#"
' MsgBox (DCount("Date", "Deposit Display", strWhere) & " Records")
If DCount("Date", "Deposit Display", strWhere) > 0 Then
DoCmd.OpenForm "Deposit Display", , , strWhere
DoCmd.Maximize
Else
MsgBox ("No Records Selected")
End If
End If
End Sub
The above is an event procedure which is causing great consternation - using
Access97.
The text boxes are on the selection form, and are all text except txtSDATE
which is a search date.
I am using as a test two records, in 1993 and 1995. If I set the search
date to 01/01/1995, then the message box displays "1 Records" - which is
correct - but the form still displays both records even though the filter
property of the query that the form is linked to is set to Date >=
"#01/01/1995#". Does anyone know if the syntax for the WHERE clause should
be different in the two situations please?
Many thanks
Peter Kinsman