C
chris
I have a form which is used for adding and entering data depending on
where it is called from. When called in add mode (acFormAdd) a blank
form is openned.
When the cursor enters the text box [Name] on the form field I am
trying test whether it is empty so that a search form can be openned
if a new name is to be added. (I don't want the search form to open in
cases when the form already has data in and I am editing rather than
adding data). The form is based on a query and the data displayed in
[Name] is the result of a calculated field in the query which
concatenates firstname and surname from a table.
I have tried this
Private Sub Name_Enter()
If IsNull(Me![Name]) = True Then
code if name is blank
End If
End Sub
and this
Private Sub Name_Enter()
If Me![Name] = "" Then
code if name is blank
End If
End Sub
to test for the text box being blank but neither works. I can only
suppose that because the contents of text box is based on a
calculation it is not actually Null or empty when nothing is displayed
in it. Can anyone explain more about this and suggest a way in which I
can perform a test to show if it is "empty" in these circumstances?
Chris
where it is called from. When called in add mode (acFormAdd) a blank
form is openned.
When the cursor enters the text box [Name] on the form field I am
trying test whether it is empty so that a search form can be openned
if a new name is to be added. (I don't want the search form to open in
cases when the form already has data in and I am editing rather than
adding data). The form is based on a query and the data displayed in
[Name] is the result of a calculated field in the query which
concatenates firstname and surname from a table.
I have tried this
Private Sub Name_Enter()
If IsNull(Me![Name]) = True Then
code if name is blank
End If
End Sub
and this
Private Sub Name_Enter()
If Me![Name] = "" Then
code if name is blank
End If
End Sub
to test for the text box being blank but neither works. I can only
suppose that because the contents of text box is based on a
calculation it is not actually Null or empty when nothing is displayed
in it. Can anyone explain more about this and suggest a way in which I
can perform a test to show if it is "empty" in these circumstances?
Chris