Greetings.
I have a form for data entry 'frmWOEntry' where the user selects from a list box "A" (has 3 columns, ID, Name, Brand) or from a seperate list box "B" (again 3 columns; ID, Name, Brand) as the item of focus for the entry form. The two list boxes contain two different catagories and cannot be combined.
I would like to create a 'if then' statement in vba for a control's OnExit event based on the user's selection.
The logic is that if the list box A has an item selected then the Brand and Name would be written into a control [WOName] and saved. The same action would be done if an item in list box B is selected.
My attempt looks like this:
Private Sub WOName_Exit(Cancel As Integer)
If [A] Is NOTNull Then
[WOName]=[AName] + " " + [ABrand]
Else
[WOName]=[BName] + " " + [BBrand]
END if
End Sub
I am getting a compile error.
Any help is HUGELY appreciated.
I have a form for data entry 'frmWOEntry' where the user selects from a list box "A" (has 3 columns, ID, Name, Brand) or from a seperate list box "B" (again 3 columns; ID, Name, Brand) as the item of focus for the entry form. The two list boxes contain two different catagories and cannot be combined.
I would like to create a 'if then' statement in vba for a control's OnExit event based on the user's selection.
The logic is that if the list box A has an item selected then the Brand and Name would be written into a control [WOName] and saved. The same action would be done if an item in list box B is selected.
My attempt looks like this:
Private Sub WOName_Exit(Cancel As Integer)
If [A] Is NOTNull Then
[WOName]=[AName] + " " + [ABrand]
Else
[WOName]=[BName] + " " + [BBrand]
END if
End Sub
I am getting a compile error.
Any help is HUGELY appreciated.