Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Simple combo filter using a date - Data Mismatch?

Status
Not open for further replies.

ste4en

Technical User
Aug 1, 2001
69
Having trouble with this simple combo report filter - not use a date for the filter before...what do i have wrong?

Private Sub Command2_Click()

Dim stDocName As String
Dim stCriteria As Date

stCriteria = "[Work Date]=" & "#" & Me![Combo0] & "#"

stDocName = "rptDailyTimeReport"
DoCmd.OpenReport stDocName, acPreview, , stCriteria


End Sub

Thanks
 


hi,
Code:
    Dim stCriteria As [red][b]STRING[/b][/red]
    
    stCriteria = "[Work Date]=" & "#" & Me![Combo0] & "#"

Skip,

[glasses] [red][/red]
[tongue]
 
How are ya ste4en . . .

. . . and this:
Code:
[blue]   stCriteria = "[Work Date] = #" & Format(Me!Combo0, "mm/dd/yyyy") & "#"[/blue]

Calvin.gif
See Ya! . . . . . .
 
thanks both, it was the Dim stCriteria As STRING rather than DATE that got me.


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top