christheancient
Registered User.
- Local time
- Today, 17:02
- Joined
- Dec 28, 2002
- Messages
- 41
Working A97.
I am trying to use unbound boxes in a form to give conditional status messages about field entries.
These statements (to date) are checked as part of the form's On Current property.
I get good messages when the statement depends on a yes/no box or on detecting if a particular character (part of a phone number) was there like in the 'business fax bit of code below.
However, I want to build further on If IsNull to determine if a field is empty and raise a conditional statement in an unbound box as in the 'business e-mail bit of code below.
It works the first time I go into the form or change the statement state. but once the If IsNull is 'triggered' the statement won't go away when I change from one record to another.
I suspect my approach is far too simplistic (but then I've got a simple mind!) and that I probably need to play with the (xxxxxxx.value) bit. But A97 Help files don't much!
I attach some of the code (and the guilty bit).
'business fax (This bit works fine)
If Mid([BusinessFax], 2, 1) = "0" Then
If RevealFax = True Then
txtFaxReveal.ForeColor = RGB(0, 0, 0)
txtFaxReveal = "You may reveal this number"
Else
txtFaxReveal.ForeColor = RGB(255, 0, 0)
txtFaxReveal = "Number is NOT to be disclosed"
End If
Else: txtFaxReveal = ""
End If
'business e-mail (This is the problem bit)
If IsNull(BusinessEMail.Value) Then
txtBusinessEMailReveal = "Address not available"
End If
Where am I going wrong please?
TIA
Chris
I am trying to use unbound boxes in a form to give conditional status messages about field entries.
These statements (to date) are checked as part of the form's On Current property.
I get good messages when the statement depends on a yes/no box or on detecting if a particular character (part of a phone number) was there like in the 'business fax bit of code below.
However, I want to build further on If IsNull to determine if a field is empty and raise a conditional statement in an unbound box as in the 'business e-mail bit of code below.
It works the first time I go into the form or change the statement state. but once the If IsNull is 'triggered' the statement won't go away when I change from one record to another.
I suspect my approach is far too simplistic (but then I've got a simple mind!) and that I probably need to play with the (xxxxxxx.value) bit. But A97 Help files don't much!
I attach some of the code (and the guilty bit).
'business fax (This bit works fine)
If Mid([BusinessFax], 2, 1) = "0" Then
If RevealFax = True Then
txtFaxReveal.ForeColor = RGB(0, 0, 0)
txtFaxReveal = "You may reveal this number"
Else
txtFaxReveal.ForeColor = RGB(255, 0, 0)
txtFaxReveal = "Number is NOT to be disclosed"
End If
Else: txtFaxReveal = ""
End If
'business e-mail (This is the problem bit)
If IsNull(BusinessEMail.Value) Then
txtBusinessEMailReveal = "Address not available"
End If
Where am I going wrong please?
TIA
Chris