"cicerone" <(E-Mail Removed)> wrote in message
<C74BE1D2-06B3-439F-B4C8-(E-Mail Removed)>:
> I am trying to print a simple nametag using the following syntax:
>
> DoCmd.OpenReport "NameTag", acViewNormal, , VID=lngVID
>
> VID refers to a field name and lngVID is a variable (long integer).
> The result of this line of code is a single printed nametag with
> #Error printing instead of [Name] as specified in the report (though
> that doesn't happen when running the report manually).
>
> Any help would be much appreciated!
The WhereCondition is a string arguement, so you need to pass it a
string, which is constructed as a valid SQL WHERE clause without the
keyword WHERE, so
DoCmd.OpenReport "NameTag", acViewNormal, , "VID=" & lngVID
would probably do the trick
--
Roy-Vidar
|