Hi.  Rather new here.  Below is an Access 97 VBA subroutine.  I am having a 
problem with the lines - "AND SaleComps.[rptdate]>=" & Me.bminrptdate.Value 
& " " & _
              "AND SaleComps.[rptdate]<=" & Me.bmaxrptdate.Value & " " & 
_.  This is where a beginning date (bminrptdate) and an ending date 
(bmaxrptdate) are entered on a form.  The format is mm/dd/yyyy and the 
fields are Short Date fields.  All the other parameters in the subroutine 
work and I've isolated the problem to the date lines.      When the command 
button is run, no records are returned.   Thanks in advance.

Gary

==============================================================================================


Private Sub cbozip_Click()
Dim db As Database
     Dim qdf As QueryDef
     Dim strSQL As String
     Set db = CurrentDb
     Set qdf = db.QueryDefs("results")


     strSQL = "SELECT SaleComps.* " & _
              "FROM SaleComps " & _
              "WHERE SaleComps.Zip='" & Me.Zip.Value & "' " & _
              "AND SaleComps.[Tunits]>=" & Me.bminunits.Value & " " & _
              "AND SaleComps.[Tunits]<=" & Me.bmaxunits.Value & " " & _
              "AND SaleComps.[YrBlt]>=" & Me.bminblt.Value & " " & _
              "AND SaleComps.[YrBlt]<=" & Me.bmaxblt.Value & " " & _
              "AND SaleComps.[rptdate]>=" & Me.bminrptdate.Value & " " & _
              "AND SaleComps.[rptdate]<=" & Me.bmaxrptdate.Value & " " & _
              "ORDER BY SaleComps.file"
    qdf.SQL = strSQL
     DoCmd.OpenQuery "results"
     DoCmd.OpenForm "Master Form"
             DoCmd.Close acForm, Me.Name
     Set qdf = Nothing
     Set db = Nothing
End Sub





------------------------ Yahoo! Groups Sponsor --------------------~--> 
Check out the new improvements in Yahoo! Groups email.
http://us.click.yahoo.com/7EuRwD/fOaOAA/yQLSAA/q7folB/TM
--------------------------------------------------------------------~-> 

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/ms_access/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/ms_access/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:[EMAIL PROTECTED] 
    mailto:[EMAIL PROTECTED]

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to