DoCmd.OpenForm

F

Fipp

I am trying to open a form that filters on several criteria

here are the two conditions:
[gain] >2 and [type] = "special pass"
[gain] >2 and [type] = "pass"

gain is a number field, type is a text field

Here is what I tried:

DoCmd.OpenForm "logfrm", , , "[gain] > 2 AND [type] = 'special pass'" Or
"[gain] > 2 AND [type] = 'pass'"
 
T

tina

try the following, as

DoCmd.OpenForm "logfrm", , , "[gain] > 2 AND ([type] = 'special pass' Or
[type] = 'pass')"

the above goes on one line, of course, regardless of line wrap in this post.

hth
 
J

Jeff Boyce

What happens when you try that?

Have you used Access HELP to make sure your syntax is correct?

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
F

Fipp

I am setting the values. They won't change

Falty said:
where abouts are the values coming from
--
Let me know if I have helped by replying or clicking question answered

Falty


Fipp said:
I am trying to open a form that filters on several criteria

here are the two conditions:
[gain] >2 and [type] = "special pass"
[gain] >2 and [type] = "pass"

gain is a number field, type is a text field

Here is what I tried:

DoCmd.OpenForm "logfrm", , , "[gain] > 2 AND [type] = 'special pass'" Or
"[gain] > 2 AND [type] = 'pass'"
 
F

Fipp

the values are in the form being opened in the [gain] field and the [type]
field.

Falty said:
where abouts are the values coming from
--
Let me know if I have helped by replying or clicking question answered

Falty


Fipp said:
I am trying to open a form that filters on several criteria

here are the two conditions:
[gain] >2 and [type] = "special pass"
[gain] >2 and [type] = "pass"

gain is a number field, type is a text field

Here is what I tried:

DoCmd.OpenForm "logfrm", , , "[gain] > 2 AND [type] = 'special pass'" Or
"[gain] > 2 AND [type] = 'pass'"
 
F

Falty

Forgive me if i am being stupid, but if you are always filtering by those
criteria could you not add them to a query an set that query as the reord
source
--
Let me know if I have helped by replying or clicking question answered

Falty


Jeff Boyce said:
What happens when you try that?

Have you used Access HELP to make sure your syntax is correct?

Regards

Jeff Boyce
Microsoft Office/Access MVP

Fipp said:
I am trying to open a form that filters on several criteria

here are the two conditions:
[gain] >2 and [type] = "special pass"
[gain] >2 and [type] = "pass"

gain is a number field, type is a text field

Here is what I tried:

DoCmd.OpenForm "logfrm", , , "[gain] > 2 AND [type] = 'special pass'" Or
"[gain] > 2 AND [type] = 'pass'"
 
M

Mike Mueller

Same thing as I was thinking


Falty said:
Forgive me if i am being stupid, but if you are always filtering by those
criteria could you not add them to a query an set that query as the reord
source
--
Let me know if I have helped by replying or clicking question answered

Falty


Jeff Boyce said:
What happens when you try that?

Have you used Access HELP to make sure your syntax is correct?

Regards

Jeff Boyce
Microsoft Office/Access MVP

Fipp said:
I am trying to open a form that filters on several criteria

here are the two conditions:
[gain] >2 and [type] = "special pass"
[gain] >2 and [type] = "pass"

gain is a number field, type is a text field

Here is what I tried:

DoCmd.OpenForm "logfrm", , , "[gain] > 2 AND [type] = 'special pass'"
Or
"[gain] > 2 AND [type] = 'pass'"
 
Top