Formula in Query

M

Miranda

IIf (DLookUp("[MaxBlisters]","[tblProductSpecs]","[product]='" & [Data
]!Product & "'") <> and ([Blisters2])= Null) , True , False

Ok, first question is, can I put a formula like this in a query that runs a
report. Second question is, does anyone see anything obviously wrong with
it? Error says wrong number of arguments. Any help is greatly appreciated!
 
J

John Spencer

You can put formulas into queries.
Your expression has bad syntax.

Can you tell us what you want in English
I think you may want something like the following, But I can't really tell
from what you have posted.

IIF(DLookup("MaxBlisters","tblProductSpecs","Product ='" & [Data].[Product]
& "' ") is null or Blisters2 is Null, True, False)
 
M

Miranda

I need to run a report that shows if any fields from my form are left blank.
However, some "products" do not require certain fields (blisters2). If the
tblProductSpecs does not list a spec (MaxBlisters) for the product chosen
(Product field) and the field (Blisters2) is left blank, then I do not want
it to show on the report.
Thanks so much!
--
Miranda


John Spencer said:
You can put formulas into queries.
Your expression has bad syntax.

Can you tell us what you want in English
I think you may want something like the following, But I can't really tell
from what you have posted.

IIF(DLookup("MaxBlisters","tblProductSpecs","Product ='" & [Data].[Product]
& "' ") is null or Blisters2 is Null, True, False)

Miranda said:
IIf (DLookUp("[MaxBlisters]","[tblProductSpecs]","[product]='" & [Data
]!Product & "'") <> and ([Blisters2])= Null) , True , False

Ok, first question is, can I put a formula like this in a query that runs
a
report. Second question is, does anyone see anything obviously wrong with
it? Error says wrong number of arguments. Any help is greatly
appreciated!
 
M

Miranda

DLookUp("[MaxBlisters]","[tblProductSpecs]","[Product] ='" & [Data].[Product]
& "' ") Is Not Null And [blisters2] Is Null
Thanks so much for your help. This worked great for me! Guess I was making
it too hard. Just used what you gave me and modified it a little and removed
the iif statement.
--
Miranda


Miranda said:
I need to run a report that shows if any fields from my form are left blank.
However, some "products" do not require certain fields (blisters2). If the
tblProductSpecs does not list a spec (MaxBlisters) for the product chosen
(Product field) and the field (Blisters2) is left blank, then I do not want
it to show on the report.
Thanks so much!
--
Miranda


John Spencer said:
You can put formulas into queries.
Your expression has bad syntax.

Can you tell us what you want in English
I think you may want something like the following, But I can't really tell
from what you have posted.

IIF(DLookup("MaxBlisters","tblProductSpecs","Product ='" & [Data].[Product]
& "' ") is null or Blisters2 is Null, True, False)

Miranda said:
IIf (DLookUp("[MaxBlisters]","[tblProductSpecs]","[product]='" & [Data
]!Product & "'") <> and ([Blisters2])= Null) , True , False

Ok, first question is, can I put a formula like this in a query that runs
a
report. Second question is, does anyone see anything obviously wrong with
it? Error says wrong number of arguments. Any help is greatly
appreciated!
 

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