thats just embarassing, Thank you much
"Dirk Goldgar" wrote:
[Quoted Text] > "Ken" <Ken[ at ]discussions.microsoft.com> wrote in message > news:AA289077-4835-4A61-B0A3-28A20857876B[ at ]microsoft.com > > I am using: > > DoCmd.OpenForm "Contacts", , , "LastName = '" & Me!List & "'" And > > "CompanyName = '" & Me!List & "'" > > on an update for a list box. It worked fine for just the last name, > > but I get the first record encountered when there are duplicates. I > > wanted to add the CompanyName and I get a type Mismatch but it is the > > same type as the last name. > > > > Any help is greatly appreciated. > > Ken > > You've got your "And" outside the quotes, where it needs to go inside > them. Try this: > > DoCmd.OpenForm "Contacts", , , _ > "LastName = '" & Me!List & _ > "' And CompanyName = '" & Me!List & "'" > > -- > Dirk Goldgar, MS Access MVP > www.datagnostics.com > > (please reply to the newsgroup) > > >
|