Opening a form using Where statement

G

Guest

From a form I'm trying to open another form using a DblClick event; the
problem I'm having is when I try to use 2 fields in the where condition; if I
use only one it works.
Here is the Where condition I'm trying to use:

DoCmd.OpenForm "frminput", , ,(("[BU]= & '" & Me![BU] & "'") And ("[Scope]=
& '" & Me![Scope] & "'"))

The error message I'm getting is:
Run-time error '13':
Type mismatch

Both fields are text.

Any idea what the problem is?

Thanks,
 
R

Rick Brandt

Tikis said:
From a form I'm trying to open another form using a DblClick event;
the problem I'm having is when I try to use 2 fields in the where
condition; if I use only one it works.
Here is the Where condition I'm trying to use:

DoCmd.OpenForm "frminput", , ,(("[BU]= & '" & Me![BU] & "'") And
("[Scope]= & '" & Me![Scope] & "'"))

The error message I'm getting is:
Run-time error '13':
Type mismatch

Both fields are text.

Any idea what the problem is?

Thanks,

, "[BU]= & '" & Me![BU] & "' And [Scope] = '" & Me![Scope] & "'"
 
G

Guest

Thank you very much, I actually had to make a little change to what you sent
me, but it works now.

This is what I ended up using:

"[BU]= '" & Me![BU] & "' And [Scope]= '" & Me![Scope] & "'"


Rick Brandt said:
Tikis said:
From a form I'm trying to open another form using a DblClick event;
the problem I'm having is when I try to use 2 fields in the where
condition; if I use only one it works.
Here is the Where condition I'm trying to use:

DoCmd.OpenForm "frminput", , ,(("[BU]= & '" & Me![BU] & "'") And
("[Scope]= & '" & Me![Scope] & "'"))

The error message I'm getting is:
Run-time error '13':
Type mismatch

Both fields are text.

Any idea what the problem is?

Thanks,

, "[BU]= & '" & Me![BU] & "' And [Scope] = '" & Me![Scope] & "'"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top