Opening a form using Where statement

T

Tikis

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] & "'"
 
T

Tikis

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] & "'"
 
Top