#Error in reports using IIF - worked previously

  • Thread starter gindlerp via AccessMonster.com
  • Start date
G

gindlerp via AccessMonster.com

Hi all;

I have the following iif statements to get data for Name & address. First,
it looks to see if there is a new name & address, if there isn't, it gets the
current name & address:

="Dr." & " " & IIf([tblUpdatesCompleted.NewFName] Is Null,
[tblUpdatesCompleted.FName],[tblUpdatesCompleted.NewFName]) & " " & IIf(
[tblUpdatesCompleted.NewLName] Is Null,[tblUpdatesCompleted.LName],
[tblUpdatesCompleted.NewLName])

=IIf([tblUpdatesCompleted.NewAddress1] Is Null,[tblUpdatesCompleted.Address1],
[tblUpdatesCompleted.NewAddress1]) & " " & IIf([tblUpdatesCompleted.
NewAddress2] Is Null,[tblUpdatesCompleted.Address2],[tblUpdatesCompleted.
NewAddress2])

=IIf([tblUpdatesCompleted.NewCity] Is Null,[tblUpdatesCompleted.City],
[tblUpdatesCompleted.NewCity]) & " " & ", " & IIf([tblUpdatesCompleted.NewSt]
Is Null,[tblUpdatesCompleted.St],[tblUpdatesCompleted.NewSt]) & " " & IIf(
[tblUpdatesCompleted.NewZIP] Is Null,[tblUpdatesCompleted.ZIP],
[tblUpdatesCompleted.ZIP])

What's odd is that it was working previously, but now only works for certain
records. The database did crash earlier, could that have anything to do with
it? Instead of the data, I'm getting #Error, but only on some & not on all.
It was working fine last time the database was used. What am I missing?

TIA.

-Pamela
 
G

gindlerp via AccessMonster.com

Never mind. Figured it out. report was based on a query, I was using a
where statement in code from the form, linking it to RecID, which for some
reason in the query recID is blank, but that's another problem...based the
report on the table instead, problem solved. :)
Hi all;

I have the following iif statements to get data for Name & address. First,
it looks to see if there is a new name & address, if there isn't, it gets the
current name & address:

="Dr." & " " & IIf([tblUpdatesCompleted.NewFName] Is Null,
[tblUpdatesCompleted.FName],[tblUpdatesCompleted.NewFName]) & " " & IIf(
[tblUpdatesCompleted.NewLName] Is Null,[tblUpdatesCompleted.LName],
[tblUpdatesCompleted.NewLName])

=IIf([tblUpdatesCompleted.NewAddress1] Is Null,[tblUpdatesCompleted.Address1],
[tblUpdatesCompleted.NewAddress1]) & " " & IIf([tblUpdatesCompleted.
NewAddress2] Is Null,[tblUpdatesCompleted.Address2],[tblUpdatesCompleted.
NewAddress2])

=IIf([tblUpdatesCompleted.NewCity] Is Null,[tblUpdatesCompleted.City],
[tblUpdatesCompleted.NewCity]) & " " & ", " & IIf([tblUpdatesCompleted.NewSt]
Is Null,[tblUpdatesCompleted.St],[tblUpdatesCompleted.NewSt]) & " " & IIf(
[tblUpdatesCompleted.NewZIP] Is Null,[tblUpdatesCompleted.ZIP],
[tblUpdatesCompleted.ZIP])

What's odd is that it was working previously, but now only works for certain
records. The database did crash earlier, could that have anything to do with
it? Instead of the data, I'm getting #Error, but only on some & not on all.
It was working fine last time the database was used. What am I missing?

TIA.

-Pamela
 
Top