Hi
I'm trying to write code on the OnLoad event of my form(FrmOfficeCust) which checks to see if a field on the Table(CustomerTable) is Empty using the field Customer to find the record. If not disable a textbox(ConTxt) on the form.
Form = FrmOfficeCust
Table= CustomerTable
Field to find record = Customer
TextBox for Customer =CustTxt
Field being checked = Contact
TextBox for Contact= ConTxt
I expect the code will look something like this
But obviously my IF statement s wrong
Any Help would be greatly appreciated
I'm trying to write code on the OnLoad event of my form(FrmOfficeCust) which checks to see if a field on the Table(CustomerTable) is Empty using the field Customer to find the record. If not disable a textbox(ConTxt) on the form.
Form = FrmOfficeCust
Table= CustomerTable
Field to find record = Customer
TextBox for Customer =CustTxt
Field being checked = Contact
TextBox for Contact= ConTxt
I expect the code will look something like this
Code:
Private Sub Form_Load()
CustTxt.Value = Forms!FrmOfficeSearch.OfficeSubform!Customer
If IsNull(CustomerTable.Contact) WHERE Customer ='" & [CustTxt] & "' Then
ConTxt.Enabled =True
Else
ConTxt.Enabled = False
End If
End Sub
Any Help would be greatly appreciated
Last edited: