Form about Employees , need header textbox not to show anything when it opens as acNewRec

Manos39

Registered User.
Local time
Today, 07:06
Joined
Feb 14, 2011
Messages
248
Hi,
i would like a form, set to go on new record on load,
Having in Header a textbox to inform reader as for " Employee Surname Name " every time is set to go around between records
What i d like is form not to show anything when it opens with no records

using so far
Code:
=IIf("[ypalillosID]"=" ";" ";"ΥΠΑΛΛΗΛΟΣ" & " " & [Epitheto] & " " & [Onoma])

still opening it shows "ΥΠΑΛΛΗΛΟΣ" (as for Employee)
 
Worked like this

Code:
=IIf([Epitheto] & ""="";" ";"Υπάλληλος" & " " & [Epitheto] & " " & [Onoma])

I am not completely aware why ypallilosID didnt do the job
 
Your original version was looking for a space. That isn't a null or a ZLS which are what the empty values would be depending on how you defined your table. Your corrected version concatenates a ZLS to the field and then checks for a ZLS. This handles both null and ZLS values because when you concatenate a null value with a ZLS, you end up with a ZLS.

PS, it is always easier to read expressions when you format them correctly.

=IIf([Epitheto] & "" = ""; " "; "Υπάλληλος" & " " & [Epitheto] & " " & [Onoma])

Access, in some situations, is flexible about spaces but it is easier for humans to parse the statement when the spaces are placed correctly. Paying attention to details like this makes your life easier and causes much less brain strain:)
 

Users who are viewing this thread

Back
Top Bottom