From: blanch2010 on

Thank you very much Duane. It's working perfectly.

Don


"Duane Hookom" wrote:

> I expect you have a report record source that might use the "*" to select all
> fields. This is generally a bad idea. You should explicitly identify/select
> individual fields from at least some of the tables.
>
> Also, if you use a criteria agains a text field, you must add some quotes:
> strWhere = "[TextFieldName]=""" & Me!txtTextField & """ "
>
> --
> Duane Hookom
> Microsoft Access MVP
>
>
> "blanch2010" wrote:
>
> > Private Sub cmdRunClientInvoice_Click()
> > Dim strDocName As String
> > Dim strWhere As String
> > strDocName = "rptBillingByClient"
> > strWhere = "[ClientID]=" & Me!ClientID
> > DoCmd.OpenReport strDocName, acPreview, , strWhere
> > End Sub
> >
> > This gets me an error stating:
> >
> > Run-time error '3079'
> > The specified field '[ClientID]' could refer to more than one table listed in
> > the From clause of your SQL statement.
> >
> > I'm not sure what I'm doing wrong but I did, instead of [ClientID] use
> > ClientLastName and I get a parameter box that pops up asking for a specific
> > client
> > lastname. Which, when I type in the client lastname, the reports opens
> > correctly.
> >
> > All of this is being done on a form that is showing two combo boxes:
> > clientid &
> > client1lastname.
> >
> > Any thoughts Duane, other then I'm all messed up?
> >
> > Thanks again
> > Don