Type mismatch access vba

Well i wanna open a form in access 2010 with parameter from controls in other form .

in "on click even" in a control in a main form i have this code :

DoCmd.OpenForm "frmShowAllBigClientsOrders", acNormal, , "[Date = #" & Format(Me.cboBigClientsOrdersDate, "mm/dd/yyyy") & "#" And "ExportBankBigClientsStatus = " & Me.cboExportBankBigClientsStatus, acFormReadOnly, acWindowNormal
I got an error :
type mismatch
how can i fix it ?
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

NorieAnalyst Assistant Commented:
There should be a ] after Date.
drtopservAuthor Commented:
sorry yea sure it is there, still have type mismatched
i just mis-typed here not in the real code in the form
Gustav BrockCIOCommented:
This should do:

DoCmd.OpenForm "frmShowAllBigClientsOrders", acNormal, , "[Date] = #" & Format(Me!cboBigClientsOrdersDate.Value, "yyyy\/mm\/dd") & "# And [ExportBankBigClientsStatus] = " & Me!cboExportBankBigClientsStatus.Value & "", acFormReadOnly, acWindowNormal

If ExportBankBigClientsStatus is text, you also need quotes:

DoCmd.OpenForm "frmShowAllBigClientsOrders", acNormal, , "[Date] = #" & Format(Me!cboBigClientsOrdersDate.Value, "yyyy\/mm\/dd") & "# And [ExportBankBigClientsStatus] = '" & Me!cboExportBankBigClientsStatus.Value & "'", acFormReadOnly, acWindowNormal


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

Dale FyeOwner, Developing Solutions LLCCommented:

One of the ways I use to debug this type of error is that I generally define the criteria string outside the OpenForm method.  This allows me to add a debug.print statement before the OpenForm method.

Dim strCriteria as string

strCriteria = "[Date] = #" & Format(Me.cboBigClientsOrdersDate, "mm/dd/yyyy") & "#"  _
                   & " And [ExportBankBigClientsStatus] = " & Me.cboExportBankBigClientsStatus
debug.print strCriteria
DoCmd.OpenForm "frmShowAllBigClientsOrders", acNormal, , strCriteria, acFormReadOnly, acWindowNormal

When I'm developing, I will generally put a breakpoint on the OpenForm line and examine the output of the print command in the immediate window before I execute the OpenForm.  This way, I can make edits to the criteria string, and move the focus back to that line to get it right before opening the new form.
You need to check for valid field values. Are the fields blank perhaps? Empty date might give that kind of error.
drtopservAuthor Commented:
@Gustav Brock
your code works!!
how did u change in it?
and what is the \/ thing in date is for?
Gustav BrockCIOCommented:
The backslash is the escape character that forces the following character, the slash, to be read literally. Otherwise, the slash would be read as the date separator which isn't always a slash but can be a hyphen - even a space.
This way the date expression will always be, say, 2015/10/11 which never will fail neither in SQL nor ADO.

drtopservAuthor Commented:
works as a charm
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.