R
richardwo
Morning,
I'm a VBA novice and am having difficulties writing a simple code in VBA. I
have designed a form using Microsoft Access, one field entitled "ContactType"
asks how the patient made contact with the service. This is linked to a
separate table and displays the options ("home visit", "telephone" and
"clinic"). When "telephone" is selected I want the next field in the form
entitled "Location" to display "N/A". I would also like this macro to run
automatically each time "ContactTye" is entered into the form.
I have tried the following, with no luck:
Sub Loc()
If ContactType = Telephone Then
Location = "N/A"
Else
End If
End Sub
I think it may be due to how I'm referencing the "Location" field in the form.
Any help would really be appreciated.
Cheers
I'm a VBA novice and am having difficulties writing a simple code in VBA. I
have designed a form using Microsoft Access, one field entitled "ContactType"
asks how the patient made contact with the service. This is linked to a
separate table and displays the options ("home visit", "telephone" and
"clinic"). When "telephone" is selected I want the next field in the form
entitled "Location" to display "N/A". I would also like this macro to run
automatically each time "ContactTye" is entered into the form.
I have tried the following, with no luck:
Sub Loc()
If ContactType = Telephone Then
Location = "N/A"
Else
End If
End Sub
I think it may be due to how I'm referencing the "Location" field in the form.
Any help would really be appreciated.
Cheers