Re: DoCmd.openForm Condition Type Mismatch
- From: "Dirk Goldgar" <dg@xxxxxxxxxxxxxxxxxxxxxx>
- Date: Fri, 1 Sep 2006 11:26:46 -0400
"Ken" <Ken@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:AA289077-4835-4A61-B0A3-28A20857876B@xxxxxxxxxxxxx
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)
.
- Prev by Date: RE: IF...THEN statement on pop-up form: possible?
- Next by Date: RE: Function to calculate yearly billing amount
- Previous by thread: RE: IF...THEN statement on pop-up form: possible?
- Next by thread: RE: Function to calculate yearly billing amount
- Index(es):
Relevant Pages
|