A
AMDGUY [MCP]
Private Sub Command6_Click()
Dim db As DAO.Database
Dim qd As QueryDef
Dim where As Variant
Set db = CurrentDb()
On Error Resume Next
db.QueryDefs.Delete ("DATEQuery")
On Error GoTo 0
where = Null
If Not IsNull(Me![fromdate]) Then
If Not IsDate(Me![fromdate]) Then
MsgBox "The value in from is not a valid date.", _
vbCritical, gstrapptitle
Exit Sub
End If
If Not IsNull(Me![todate]) Then
If Not IsDate(Me![todate]) Then
MsgBox "The value in to is not a valid date.", _
vbCritical, gstrapptitle
Exit Sub
End If
End If
End If
Set qd = db.CreateQueryDef("DATEQuery", _
"select * from DATE " & (" where " + Mid(where, 6) & ";"))
End Sub
Dim db As DAO.Database
Dim qd As QueryDef
Dim where As Variant
Set db = CurrentDb()
On Error Resume Next
db.QueryDefs.Delete ("DATEQuery")
On Error GoTo 0
where = Null
If Not IsNull(Me![fromdate]) Then
If Not IsDate(Me![fromdate]) Then
MsgBox "The value in from is not a valid date.", _
vbCritical, gstrapptitle
Exit Sub
End If
If Not IsNull(Me![todate]) Then
If Not IsDate(Me![todate]) Then
MsgBox "The value in to is not a valid date.", _
vbCritical, gstrapptitle
Exit Sub
End If
End If
End If
Set qd = db.CreateQueryDef("DATEQuery", _
"select * from DATE " & (" where " + Mid(where, 6) & ";"))
End Sub