I
ipower2
I have a report which pulls the following fields from a query and populates
into a unbound textbox. The vb is on the ON Format of the detail section.
My main problem is that I do not get all the inforation mainly the phone
numbers. I have up to 4 possible phone numbers, however, not all employees
will have information in all 4. The order of the numbers is home phone,
alternate phone 1, mobilephone, and alternate phone 2. I need to be able
through code print the numbers if there is info, but if there isn't then
ignore the field and move on the next record.
This is my code...
Me.Text25 = [LastName] & ", " & [FirstName] & " #" & [Badge #] & _
Chr(13) & Chr(10) & [Address] & ", " & [City] & " " & [PostalCode] & _
Chr(13) & Chr(10) & Format(IIf(Nz([HomePhone], "") = "", [AltPh1], [HomePhone]
& " "), "(@@@)@@@-@@@@") & _
Format(IIf(Nz([AltPh1], "") = "", [MobilePhone], [AltPh1] & " "), "
(@@@)@@@-@@@@") & _
Chr(13) & Chr(10) & Format(IIf(Nz([AltPh1], "") <> "", [MobilePhone] & "
", [AltPh1]), "(@@@)@@@-@@@@") & _
IIf(Nz([AltPh2], "") <> "", "", [AltPh2])
I think I am so close...but I am unsure...I think a new pair of eyes should
solve the problem...
Any help will be appreciated.
Thanks,
Ivan
into a unbound textbox. The vb is on the ON Format of the detail section.
My main problem is that I do not get all the inforation mainly the phone
numbers. I have up to 4 possible phone numbers, however, not all employees
will have information in all 4. The order of the numbers is home phone,
alternate phone 1, mobilephone, and alternate phone 2. I need to be able
through code print the numbers if there is info, but if there isn't then
ignore the field and move on the next record.
This is my code...
Me.Text25 = [LastName] & ", " & [FirstName] & " #" & [Badge #] & _
Chr(13) & Chr(10) & [Address] & ", " & [City] & " " & [PostalCode] & _
Chr(13) & Chr(10) & Format(IIf(Nz([HomePhone], "") = "", [AltPh1], [HomePhone]
& " "), "(@@@)@@@-@@@@") & _
Format(IIf(Nz([AltPh1], "") = "", [MobilePhone], [AltPh1] & " "), "
(@@@)@@@-@@@@") & _
Chr(13) & Chr(10) & Format(IIf(Nz([AltPh1], "") <> "", [MobilePhone] & "
", [AltPh1]), "(@@@)@@@-@@@@") & _
IIf(Nz([AltPh2], "") <> "", "", [AltPh2])
I think I am so close...but I am unsure...I think a new pair of eyes should
solve the problem...
Any help will be appreciated.
Thanks,
Ivan