Re: Open Report based on a drop down box
- From: "ielmrani via AccessMonster.com" <u21259@uwe>
- Date: Fri, 26 May 2006 02:49:02 GMT
Thank you so much guys, I wil try your suggestions and let you know.
Ismail
Marshall Barton wrote:
I am using a form to run a report based on a combo box and it's working fine.[quoted text clipped - 15 lines]
DoCmd.OpenReport "Qrytest", acViewPreview, , strWhere
End Sub
Just add more If blocks of code and add " AND " for each
condition. Then general idea is something like this:
If IsNull(Combo0) = False Then
strWhere = " AND ProvNm = '" & Combo0 & "'"
End If
If IsNull(txtStart) = False Then
strWhere = " AND datefield >= " _
& Format(txtStart, "\#m\/d\/yyyy\#")
End If
If IsNull(txtEnd) = False Then
strWhere = " AND datefield <= " _
& Format(txtEnd, "\#m\/d\/yyyy\#")
End If
strWhere = Mid(strWhere, 6) 'dump extra AND
--
Message posted via http://www.accessmonster.com
.
- References:
- Open Report based on a drop down box
- From: ielmrani via AccessMonster.com
- Re: Open Report based on a drop down box
- From: Marshall Barton
- Open Report based on a drop down box
- Prev by Date: Re: Todays End number becomes tomorrows start number!
- Next by Date: Re: Browse Directory
- Previous by thread: Re: Open Report based on a drop down box
- Next by thread: Re: Open Report based on a drop down box
- Index(es):
Relevant Pages
|