selecting null with an iif expression in criteria access 2k3

  • Thread starter Leslie Porter OHV
  • Start date
L

Leslie Porter OHV

i have a form that when filled out opens multiple reports from on query. it
works all well except for one thing. i have one field, "slicemach", that i
choose criteria using this expression:
IIf([forms]![Slicing Sheets - print]![hrmachCheck]=True,"HR",Null) Or
IIf([forms]![Slicing Sheets - print]![vertmachCheck]=True,"Vert",Null)
I have 2 check marks:
hrmachCheck and vertmachCheck. all works fine except for null values. if the
field is blank i cant seem to get them. so i tried this:
IIf([forms]![Slicing Sheets - print]![hrmachCheck]=True,"HR",Null) Or
IIf([forms]![Slicing Sheets - print]![vertmachCheck]=True,"Vert",Null) Or
IIf([forms]![Slicing Sheets - print]![othermachcheck]=True,Like "*",Null)

and this:
IIf([forms]![Slicing Sheets - print]![hrmachCheck]=True,"HR",Null) Or
IIf([forms]![Slicing Sheets - print]![vertmachCheck]=True,"Vert",Null) Or
IIf([forms]![Slicing Sheets - print]![othermachcheck]=True,is null,Null)

and still does not work. if i clear it all out and just enter:
is null

then if picks them but the expression:
IIf([forms]![Slicing Sheets - print]![othermachcheck]=True,is null,Null)

does not. what am i missing?
 
W

Wayne-I-M

Hi Leslie

Sorry - but lost with this. What are you trying to do.
IIf([forms]![Slicing Sheets - print]![hrmachCheck]=True,"HR",Null) Or
IIf([forms]![Slicing Sheets - print]![vertmachCheck]=True,"Vert",Null) Or
IIf([forms]![Slicing Sheets - print]![othermachcheck]=True,Like "*",Null)

Can you give an example.
Are you trying to select a certain report to open/print from a number of
possible reports. Are you passing the Value of a text box to a report.

??? Can you explain the "end result" - what do you want to either ticked or
unticked boxes to do

Sorry to be a little dim - it's 5pm and nearly home time


--
Wayne
Manchester, England.



Leslie Porter OHV said:
i have a form that when filled out opens multiple reports from on query. it
works all well except for one thing. i have one field, "slicemach", that i
choose criteria using this expression:
IIf([forms]![Slicing Sheets - print]![hrmachCheck]=True,"HR",Null) Or
IIf([forms]![Slicing Sheets - print]![vertmachCheck]=True,"Vert",Null)
I have 2 check marks:
hrmachCheck and vertmachCheck. all works fine except for null values. if the
field is blank i cant seem to get them. so i tried this:
IIf([forms]![Slicing Sheets - print]![hrmachCheck]=True,"HR",Null) Or
IIf([forms]![Slicing Sheets - print]![vertmachCheck]=True,"Vert",Null) Or
IIf([forms]![Slicing Sheets - print]![othermachcheck]=True,Like "*",Null)

and this:
IIf([forms]![Slicing Sheets - print]![hrmachCheck]=True,"HR",Null) Or
IIf([forms]![Slicing Sheets - print]![vertmachCheck]=True,"Vert",Null) Or
IIf([forms]![Slicing Sheets - print]![othermachcheck]=True,is null,Null)

and still does not work. if i clear it all out and just enter:
is null

then if picks them but the expression:
IIf([forms]![Slicing Sheets - print]![othermachcheck]=True,is null,Null)

does not. what am i missing?
 
S

Sylvain Lafontaine

I'm sorry to say that but like Wayne (see the other post); I totally don't
understand what you're trying to achieve here. If we take a look at your
first example:

IIf([forms]![Slicing Sheets - print]![hrmachCheck]=True,"HR",Null) Or
IIf([forms]![Slicing Sheets - print]![vertmachCheck]=True,"Vert",Null)

you seem to have build build some kind of logical expression - because you
are using the OR operator - but this expression will return either True or
Null instead of the more usual True or False. Maybe this is what you want
but even if this is the case, using an IIF() here make no sense because the
values "HR" and "VR" will remains unused excerpt for the fact that they
means True in this context. Knowing that "HR" and "VR" can only have the
value True here; we can rewrite it as:

IIf([forms]![Slicing Sheets - print]![hrmachCheck]=True,True,Null) Or
IIf([forms]![Slicing Sheets - print]![vertmachCheck]=True,True,Null)

Again, this expression doesn't make any sense to me.

For testing for the Null value, you can either use the IsNull() function,
the Is Null operator or even the NZ() function; for example:

IIf([forms]![Slicing Sheets - print]![hrmachCheck] is Not Null AND
[forms]![Slicing Sheets - print]![hrmachCheck]=True,True,Null) .......

IIf(Not IsNull([forms]![Slicing Sheets - print]![hrmachCheck] AND
[forms]![Slicing Sheets - print]![hrmachCheck]=True,True,Null) .......

IIf(NZ([forms]![Slicing Sheets - print]![hrmachCheck], False)
=True,True,Null) ......

--
Sylvain Lafontaine, ing.
MVP - Technologies Virtual-PC
E-mail: sylvain aei ca (fill the blanks, no spam please)


Leslie Porter OHV said:
i have a form that when filled out opens multiple reports from on query. it
works all well except for one thing. i have one field, "slicemach", that i
choose criteria using this expression:
IIf([forms]![Slicing Sheets - print]![hrmachCheck]=True,"HR",Null) Or
IIf([forms]![Slicing Sheets - print]![vertmachCheck]=True,"Vert",Null)
I have 2 check marks:
hrmachCheck and vertmachCheck. all works fine except for null values. if
the
field is blank i cant seem to get them. so i tried this:
IIf([forms]![Slicing Sheets - print]![hrmachCheck]=True,"HR",Null) Or
IIf([forms]![Slicing Sheets - print]![vertmachCheck]=True,"Vert",Null) Or
IIf([forms]![Slicing Sheets - print]![othermachcheck]=True,Like "*",Null)

and this:
IIf([forms]![Slicing Sheets - print]![hrmachCheck]=True,"HR",Null) Or
IIf([forms]![Slicing Sheets - print]![vertmachCheck]=True,"Vert",Null) Or
IIf([forms]![Slicing Sheets - print]![othermachcheck]=True,is null,Null)

and still does not work. if i clear it all out and just enter:
is null

then if picks them but the expression:
IIf([forms]![Slicing Sheets - print]![othermachcheck]=True,is null,Null)

does not. what am i missing?
 
L

Leslie Porter OHV

Sylvain Lafontaine said:
I'm sorry to say that but like Wayne (see the other post); I totally don't
understand what you're trying to achieve here.


ok sorry if i was to vauge. im probly doing it all wrong anyways. im more of
a cobbler though i dont want to be...

the querry will look up a bunch of fields but is activated by a button. i
have text boxes holding most of what i need for criteria except the machine.
i made check boxes for the machines since there are so few. 2 to be exact but
we will be adding. the 2 machines are hr and vert. but not always is the
machine info in the record thus a null. so i was going to make another check
box for other which should choose null or everything. either would work thoug
i would rather it be null.

i thought about making an invisible text box to store the info acording to
the check box selection and then the query could just read the info from it
but i was sure i could do it easily with code. and it has other than the null
thing.

is this enough?
 
S

Sylvain Lafontaine

Leslie Porter OHV said:
ok sorry if i was to vauge. im probly doing it all wrong anyways. im more
of
a cobbler though i dont want to be...

the querry will look up a bunch of fields but is activated by a button. i
have text boxes holding most of what i need for criteria except the
machine.
i made check boxes for the machines since there are so few. 2 to be exact
but
we will be adding. the 2 machines are hr and vert. but not always is the
machine info in the record thus a null. so i was going to make another
check
box for other which should choose null or everything. either would work
thoug
i would rather it be null.

i thought about making an invisible text box to store the info acording to
the check box selection and then the query could just read the info from
it
but i was sure i could do it easily with code. and it has other than the
null
thing.

is this enough?

Not really. Did you read my previous and try to understand it? For
example, I gave you some examples of code for dealing with the Null value;
did you try to see if you could use them to solve your problem?

Second, Wayne and me, we have also made some comments about your examples of
code and your original post. Did you try to read these comments and try to
understand *what we don't understand ourselves* from all of this?

Some examples of informations that could be useful:

1- where are located these famous controls; on the form or on one of the
reports?

2- what is exactly the data source of each of these controls (without mixing
them) ?

3- How are you expecting this information to be displayed in each of these
controls; especially under various conditions from the data source(s) ?

4- How is exactly the information stored and how it is retrieved?

5- Etc., etc.
 
W

Wayne-I-M

Still not sure - sorry.

I "think" you are looking to select a machine (that does something ??) from
a maximum of 4 machines (if there are are more you could make a very simple
table with the names of the machines in). Anyway - the 4 you have now. Why
now use a combo or even an option group. Either of these can be used a
criteria for a query or (if you prefer) you could set the value of a text box
after you have selected an option from either a combo or list or option group

I think I have still misunderstanding what you are trying to do.

Keep going, you will get an answer from someone :)
 
L

Leslie Porter OHV

Wayne-I-M said:
Still not sure - sorry.
I think I have still misunderstanding what you are trying to do.


yup but its ok im not always the best at explaining things...

the form and controls have no direct connection to anything. text boxes are
just text boxes and check boxes are just check boxes.

i have 4 reports that all use the information from a query.

the query and all the reports are activated by a button. code below:

Private Sub PreviewSliceReports_Click()
On Error GoTo Err_PreviewSliceReports_Click

Dim stDocName As String

If Check30.Value = True Then
stDocName = "Form - Slicing Sheet - Stickers"
DoCmd.OpenReport stDocName, acPreview
ElseIf Check30.Value = False Then

End If
If Check32.Value = True Then
stDocName = "Form - Sling Sheet"
DoCmd.OpenReport stDocName, acPreview
ElseIf Check32.Value = False Then

End If
If Check26.Value = True Then
stDocName = "Form - Slicing Sheet - Slicer"
DoCmd.OpenReport stDocName, acPreview
ElseIf Check26.Value = False Then

End If

If Check28.Value = True Then
stDocName = "Form - Slicing Sheet - Dryer"
DoCmd.OpenReport stDocName, acPreview
ElseIf Check28.Value = False Then

End If

Exit_PreviewSliceReports_Click:
Exit Sub

Err_PreviewSliceReports_Click:
MsgBox Err.Description
Resume Exit_PreviewSliceReports_Click

End Sub


and the criteria in the query is gatherd like so...

Like [forms]![Slicing Sheets - print]![PreviewSliceReportsbatch1] Or Like
[forms]![Slicing Sheets - print]![PreviewSliceReportsbatch2] Or Like
[forms]![Slicing Sheets - print]![PreviewSliceReportsbatch3] Or Like
[forms]![Slicing Sheets - print]![PreviewSliceReportsbatch4]

(this is 4 text boxes allows up to 4 things to be selected)

but this one:
IIf([forms]![Slicing Sheets - print]![hrmachCheck]=True,"HR",Null) Or
IIf([forms]![Slicing Sheets - print]![vertmachCheck]=True,"Vert",Null)

is where im having problems.

this is probly not the proper way to do it but its the way i know how to do
it...
 
S

Sylvain Lafontaine

So « IIf([forms]![Slicing Sheets - print]![hrmachCheck]=True,"HR",Null) Or
IIf([forms]![Slicing Sheets - print]![vertmachCheck]=True,"Vert",Null) » is
part of a query and its result must be returned into a single column. Also,
I suppose that both [hrmachCheck] and [hrmachCheck] cannot be true at the
same time. Try:

IIf(NZ([forms]![Slicing Sheets - print]![hrmachCheck],False)=True,"HR",
IIf(NZ([forms]![Slicing Sheets -
print]![vertmachCheck],False)=True,"Vert",Null))

Notice that the second IIf() has been incorporated into the first one.

--
Sylvain Lafontaine, ing.
MVP - Technologies Virtual-PC
E-mail: sylvain aei ca (fill the blanks, no spam please)


Leslie Porter OHV said:
Wayne-I-M said:
Still not sure - sorry.
I think I have still misunderstanding what you are trying to do.


yup but its ok im not always the best at explaining things...

the form and controls have no direct connection to anything. text boxes
are
just text boxes and check boxes are just check boxes.

i have 4 reports that all use the information from a query.

the query and all the reports are activated by a button. code below:

Private Sub PreviewSliceReports_Click()
On Error GoTo Err_PreviewSliceReports_Click

Dim stDocName As String

If Check30.Value = True Then
stDocName = "Form - Slicing Sheet - Stickers"
DoCmd.OpenReport stDocName, acPreview
ElseIf Check30.Value = False Then

End If
If Check32.Value = True Then
stDocName = "Form - Sling Sheet"
DoCmd.OpenReport stDocName, acPreview
ElseIf Check32.Value = False Then

End If
If Check26.Value = True Then
stDocName = "Form - Slicing Sheet - Slicer"
DoCmd.OpenReport stDocName, acPreview
ElseIf Check26.Value = False Then

End If

If Check28.Value = True Then
stDocName = "Form - Slicing Sheet - Dryer"
DoCmd.OpenReport stDocName, acPreview
ElseIf Check28.Value = False Then

End If

Exit_PreviewSliceReports_Click:
Exit Sub

Err_PreviewSliceReports_Click:
MsgBox Err.Description
Resume Exit_PreviewSliceReports_Click

End Sub


and the criteria in the query is gatherd like so...

Like [forms]![Slicing Sheets - print]![PreviewSliceReportsbatch1] Or Like
[forms]![Slicing Sheets - print]![PreviewSliceReportsbatch2] Or Like
[forms]![Slicing Sheets - print]![PreviewSliceReportsbatch3] Or Like
[forms]![Slicing Sheets - print]![PreviewSliceReportsbatch4]

(this is 4 text boxes allows up to 4 things to be selected)

but this one:
IIf([forms]![Slicing Sheets - print]![hrmachCheck]=True,"HR",Null) Or
IIf([forms]![Slicing Sheets - print]![vertmachCheck]=True,"Vert",Null)

is where im having problems.

this is probly not the proper way to do it but its the way i know how to
do
it...
 
S

Sylvain Lafontaine

Also, usually, it's not a good idea to have a checkbox with tri-state: Null,
False or True. You should deactive the tri-state and set its default value
to False (or to True).

--
Sylvain Lafontaine, ing.
MVP - Technologies Virtual-PC
E-mail: sylvain aei ca (fill the blanks, no spam please)


Sylvain Lafontaine said:
So « IIf([forms]![Slicing Sheets - print]![hrmachCheck]=True,"HR",Null) Or
IIf([forms]![Slicing Sheets - print]![vertmachCheck]=True,"Vert",Null) »
is part of a query and its result must be returned into a single column.
Also, I suppose that both [hrmachCheck] and [hrmachCheck] cannot be true
at the same time. Try:

IIf(NZ([forms]![Slicing Sheets - print]![hrmachCheck],False)=True,"HR",
IIf(NZ([forms]![Slicing Sheets -
print]![vertmachCheck],False)=True,"Vert",Null))

Notice that the second IIf() has been incorporated into the first one.

--
Sylvain Lafontaine, ing.
MVP - Technologies Virtual-PC
E-mail: sylvain aei ca (fill the blanks, no spam please)


Leslie Porter OHV said:
Wayne-I-M said:
Still not sure - sorry.
I think I have still misunderstanding what you are trying to do.


yup but its ok im not always the best at explaining things...

the form and controls have no direct connection to anything. text boxes
are
just text boxes and check boxes are just check boxes.

i have 4 reports that all use the information from a query.

the query and all the reports are activated by a button. code below:

Private Sub PreviewSliceReports_Click()
On Error GoTo Err_PreviewSliceReports_Click

Dim stDocName As String

If Check30.Value = True Then
stDocName = "Form - Slicing Sheet - Stickers"
DoCmd.OpenReport stDocName, acPreview
ElseIf Check30.Value = False Then

End If
If Check32.Value = True Then
stDocName = "Form - Sling Sheet"
DoCmd.OpenReport stDocName, acPreview
ElseIf Check32.Value = False Then

End If
If Check26.Value = True Then
stDocName = "Form - Slicing Sheet - Slicer"
DoCmd.OpenReport stDocName, acPreview
ElseIf Check26.Value = False Then

End If

If Check28.Value = True Then
stDocName = "Form - Slicing Sheet - Dryer"
DoCmd.OpenReport stDocName, acPreview
ElseIf Check28.Value = False Then

End If

Exit_PreviewSliceReports_Click:
Exit Sub

Err_PreviewSliceReports_Click:
MsgBox Err.Description
Resume Exit_PreviewSliceReports_Click

End Sub


and the criteria in the query is gatherd like so...

Like [forms]![Slicing Sheets - print]![PreviewSliceReportsbatch1] Or Like
[forms]![Slicing Sheets - print]![PreviewSliceReportsbatch2] Or Like
[forms]![Slicing Sheets - print]![PreviewSliceReportsbatch3] Or Like
[forms]![Slicing Sheets - print]![PreviewSliceReportsbatch4]

(this is 4 text boxes allows up to 4 things to be selected)

but this one:
IIf([forms]![Slicing Sheets - print]![hrmachCheck]=True,"HR",Null) Or
IIf([forms]![Slicing Sheets - print]![vertmachCheck]=True,"Vert",Null)

is where im having problems.

this is probly not the proper way to do it but its the way i know how to
do
it...
 
L

Leslie Porter OHV

Sylvain Lafontaine said:
So « IIf([forms]![Slicing Sheets - print]![hrmachCheck]=True,"HR",Null) Or
IIf([forms]![Slicing Sheets - print]![vertmachCheck]=True,"Vert",Null) » is
part of a query and its result must be returned into a single column. Also,
I suppose that both [hrmachCheck] and [hrmachCheck] cannot be true at the
same time.

nope it needs to be any of the above. only sometimes do i need one or the
other but some times i need them all. some times i need vert and all null and
some times i need hr and null.
i was trying to make them either or
 
L

Leslie Porter OHV

i sopose it would probly be easier to built it in code with the for and have
it place it in an invisible text boxt that could be read? but again how would
i get the vert + null or hr + null or even all of them? if i just make it ask

like([ Enter Machine ]) or like([ Enter Machine ]) or like([ Enter Machine
])

it works ok except the null

Sylvain Lafontaine said:
Also, usually, it's not a good idea to have a checkbox with tri-state: Null,
False or True. You should deactive the tri-state and set its default value
to False (or to True).

--
Sylvain Lafontaine, ing.
MVP - Technologies Virtual-PC
E-mail: sylvain aei ca (fill the blanks, no spam please)


Sylvain Lafontaine said:
So « IIf([forms]![Slicing Sheets - print]![hrmachCheck]=True,"HR",Null) Or
IIf([forms]![Slicing Sheets - print]![vertmachCheck]=True,"Vert",Null) »
is part of a query and its result must be returned into a single column.
Also, I suppose that both [hrmachCheck] and [hrmachCheck] cannot be true
at the same time. Try:

IIf(NZ([forms]![Slicing Sheets - print]![hrmachCheck],False)=True,"HR",
IIf(NZ([forms]![Slicing Sheets -
print]![vertmachCheck],False)=True,"Vert",Null))

Notice that the second IIf() has been incorporated into the first one.

--
Sylvain Lafontaine, ing.
MVP - Technologies Virtual-PC
E-mail: sylvain aei ca (fill the blanks, no spam please)


Leslie Porter OHV said:
:

Still not sure - sorry.
I think I have still misunderstanding what you are trying to do.


yup but its ok im not always the best at explaining things...

the form and controls have no direct connection to anything. text boxes
are
just text boxes and check boxes are just check boxes.

i have 4 reports that all use the information from a query.

the query and all the reports are activated by a button. code below:

Private Sub PreviewSliceReports_Click()
On Error GoTo Err_PreviewSliceReports_Click

Dim stDocName As String

If Check30.Value = True Then
stDocName = "Form - Slicing Sheet - Stickers"
DoCmd.OpenReport stDocName, acPreview
ElseIf Check30.Value = False Then

End If
If Check32.Value = True Then
stDocName = "Form - Sling Sheet"
DoCmd.OpenReport stDocName, acPreview
ElseIf Check32.Value = False Then

End If
If Check26.Value = True Then
stDocName = "Form - Slicing Sheet - Slicer"
DoCmd.OpenReport stDocName, acPreview
ElseIf Check26.Value = False Then

End If

If Check28.Value = True Then
stDocName = "Form - Slicing Sheet - Dryer"
DoCmd.OpenReport stDocName, acPreview
ElseIf Check28.Value = False Then

End If

Exit_PreviewSliceReports_Click:
Exit Sub

Err_PreviewSliceReports_Click:
MsgBox Err.Description
Resume Exit_PreviewSliceReports_Click

End Sub


and the criteria in the query is gatherd like so...

Like [forms]![Slicing Sheets - print]![PreviewSliceReportsbatch1] Or Like
[forms]![Slicing Sheets - print]![PreviewSliceReportsbatch2] Or Like
[forms]![Slicing Sheets - print]![PreviewSliceReportsbatch3] Or Like
[forms]![Slicing Sheets - print]![PreviewSliceReportsbatch4]

(this is 4 text boxes allows up to 4 things to be selected)

but this one:
IIf([forms]![Slicing Sheets - print]![hrmachCheck]=True,"HR",Null) Or
IIf([forms]![Slicing Sheets - print]![vertmachCheck]=True,"Vert",Null)

is where im having problems.

this is probly not the proper way to do it but its the way i know how to
do
it...
 
S

Sylvain Lafontaine

Leslie Porter OHV said:
i sopose it would probly be easier to built it in code with the for and
have
it place it in an invisible text boxt that could be read? but again how
would
i get the vert + null or hr + null or even all of them? if i just make it
ask

like([ Enter Machine ]) or like([ Enter Machine ]) or like([ Enter
Machine
])

it works ok except the null

You're still explaining your problem under the cover of some vague and
partial narrative. If you're not willing to take the time of explaining
your own problem - and to read the previous posts that we have made, why
should we bother to spent some of our time trying to help you?

You are saying that you have a problem with the null's but you don't say
where they are or from where they're coming from. Are these null's coming
from the checkbox on the form or if they are set on the underlying data
source? Also, you don't explain how these null should be dealt with.

Finally, you don't give a single hint that you might have read with
attention our previous posts. We have given many examples on how to dealing
with null under various conditions. There is a high probability that if you
take the time of reading and trying to understanding them, you'll be able to
do what you are looking for.

If you want another answer, please post back a detailed description of your
problem in its simplest form.
 
L

Leslie Porter OHV

Sylvain Lafontaine said:
You're still explaining your problem under the cover of some vague and
partial narrative. If you're not willing to take the time of explaining
your own problem - and to read the previous posts that we have made, why
should we bother to spent some of our time trying to help you?

i have tried to explain this the best i can and i have read the previous
post's. i have also tried them. there is no reason you have to be harsh with
me. and try to take some of your own adive. READ what i am saying. this is
simple logic...

3 check box's
Vert
HR
Other

the field will have records with one of these three things is it.
vert, hr, and null(nothing entered for this record yet).

the 3 check boxes have no connected data/fields.
the button brings up a report that starts a query. the criterea in the query
is this Query Critera Code:
IIf([forms]![Slicing Sheets - print]![hrmachCheck]=True,"HR",Null) Or
IIf([forms]![Slicing Sheets - print]![vertmachCheck]=True,"Vert",Null)

this works for selecting vert, hr, vert and hr. but some times i need to be
able to select all the null. thus i tried this code:
IIf([forms]![Slicing Sheets - print]![hrmachCheck]=True,"HR",Null) Or
IIf([forms]![Slicing Sheets - print]![vertmachCheck]=True,"Vert",Null) Or
IIf([forms]![Slicing Sheets - print]![othermachcheck]=True,is null,Null)

and many combinations including nesting the iif's but wont select the empty
records.

if this is not enough info please tell me what you want/need? if you dont
want to help fine just say so, but please dont be mean or harsh. i am the
student you are soposed to be the teacher and should understand my inability
to convey or understand.
 
S

Sylvain Lafontaine

Could you post the full text of the query, the one where the expression
«
IIf([forms]![Slicing Sheets - print]![hrmachCheck]=True,"HR",Null) Or
IIf([forms]![Slicing Sheets - print]![vertmachCheck]=True,"Vert",Null)
»

is located? The problem is that we don't understand how this expression is
used to filter the rows out of a table or of another query/view. We don't
even know if the expression is located in the WHERE statement of the query
or if it is located in the Select part, with the filtering taking place
directly on the form with an OnFilter expression. A third possibility would
have be that you have placed this expression as the data source of a text
control and use it to filter your form and probably that with a little
searching, I could find other places where to place it.

Its emplacement and how you're using it to filter your form (or report)
might seem obvious to you but it is not for me because, unlike you, I don't
have your project in front of me.

If you're using an OnFilter expression, posting it would also be a good idea
because it tells us how these two expressions are working together.

For posting here a copy of your query, if you don't know how to see the SQL
text code of a querydef, right click on the schema of the tables while
you're in design mode and select "SQL View". This option is also available
from one of the button of the Query Design toolbar menu (usually the first
button on the left). If you're unsure on how to do this, make a copy of the
query first by using Copy&Paste or the "Save as" option from the contextual
menu (the one that you get with the right click of the mouse) or even
better, make a copy of the MDB or ACCDB database file before.

Posting an extract of the schema/design of the tables could also help here;
along with a sample of the data.

--
Sylvain Lafontaine, ing.
MVP - Technologies Virtual-PC
E-mail: sylvain aei ca (fill the blanks, no spam please)


Leslie Porter OHV said:
Sylvain Lafontaine said:
You're still explaining your problem under the cover of some vague and
partial narrative. If you're not willing to take the time of explaining
your own problem - and to read the previous posts that we have made, why
should we bother to spent some of our time trying to help you?

i have tried to explain this the best i can and i have read the previous
post's. i have also tried them. there is no reason you have to be harsh
with
me. and try to take some of your own adive. READ what i am saying. this is
simple logic...

3 check box's
Vert
HR
Other

the field will have records with one of these three things is it.
vert, hr, and null(nothing entered for this record yet).

the 3 check boxes have no connected data/fields.
the button brings up a report that starts a query. the criterea in the
query
is this Query Critera Code:
IIf([forms]![Slicing Sheets - print]![hrmachCheck]=True,"HR",Null) Or
IIf([forms]![Slicing Sheets - print]![vertmachCheck]=True,"Vert",Null)

this works for selecting vert, hr, vert and hr. but some times i need to
be
able to select all the null. thus i tried this code:
IIf([forms]![Slicing Sheets - print]![hrmachCheck]=True,"HR",Null) Or
IIf([forms]![Slicing Sheets - print]![vertmachCheck]=True,"Vert",Null) Or
IIf([forms]![Slicing Sheets - print]![othermachcheck]=True,is null,Null)

and many combinations including nesting the iif's but wont select the
empty
records.

if this is not enough info please tell me what you want/need? if you dont
want to help fine just say so, but please dont be mean or harsh. i am the
student you are soposed to be the teacher and should understand my
inability
to convey or understand.
 

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