Could someone please give the right syntax?
SAMPLE CODE
Dim varItem As Variant
Dim strWhere As String
Dim ctl As Control
strWhere = "[Name] in("
Set ctl = Me![List1]
For Each varItem In ctl.ItemsSelected
strWhere = strWhere & Chr$(34) & ctl.ItemData(varItem)
& Chr$(34) & ","
Next
strWhere = Left$(strWhere, Len(strWhere) - 1) & ")"
DoCmd.OpenReport "rpt1", acViewPreview, , strWhere And "[Date] Between Forms![frmSearchLoadByOwner]![StartDate] And Forms![frmSearchLoadByOwner]![EndDate]"
Thanks
Wally
DoCmd.OpenReport "rpt1", acViewPreview, , strWhere & " And [Date] Between
Forms![frmSearchLoadByOwner]![StartDate] And
Forms![frmSearchLoadByOwner]![EndDate]"
Fred
Wally Davenport <wa...@dryden.net> wrote in message
news:38421983...@dryden.net...
Your suggestion works just fine. I am a newbe at this and I never thought of
trying it that way.
Until my next problem
Wally
fredg wrote:
> Hi Wally,
> What's one & more or less?
> Did you try:
>
> DoCmd.OpenReport "rpt1", acViewPreview, , strWhere & " And [Date] Between
> Forms![frmSearchLoadByOwner]![StartDate] And
> Forms![frmSearchLoadByOwner]![EndDate]"
>
> Fred