-
I have tried both and the fields do not update. Perhaps I'm using it wrong. With LostFocus, at least when I leave the dropdown box, the other fields get updated. What am i doing wrong?
[VBA]
Private Sub cmbName_BeforeUpdate() 'LostFocus()
'*********************
On Error GoTo MyErrorHandler:
Call SortTable
Call FindRecorNumber
'Puts Vlookup results in respective cells
'If cmbName = Change Then
txtCity.Value = WorksheetFunction.VLookup(cmbName.Value, Range("TestTable"), 2, False)
cmbState.Value = WorksheetFunction.VLookup(cmbName.Value, Range("TestTable"), 3, False)
Range("P4") = WorksheetFunction.VLookup(cmbName.Value, Range("TestTable"), 4, False)
Range("Q4") = WorksheetFunction.VLookup(cmbName.Value, Range("TestTable"), 5, False)
'Me.lblRowNumber.Caption = 2
'Else
' Debug.Print "I'm here"
'End If
MyErrorHandler:
Call CheckEnabled
End Sub
[/VBA]
Is this right?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules