Hi all,
Can anyone explain to me why this first code works
Private Sub Username_AfterUpdate()
Me.pwdcheck1.Visible = True
Me.pwdcheck1 = Application.WorksheetFunction.VLookup(Me.Username, Sheet2.Range("G:H"), 2, False)
Me.pwdcheck1.Visible = False
End Sub
and why this second code doesn't?
Private Sub CboPatient_AfterUpdate()
Me.AUID = Me.CboPatient
Me.AUID.SetFocus
Me.Surname = Application.WorksheetFunction.VLookup(Me.AUID, Sheets("Registrations").Range("B:D"), 3, False)
<Error Code breaks here>
Me.Firstname = Application.WorksheetFunction.VLookup(Me.AUID, Sheet3.Range("B:E"), 4, False)
End Sub
I tried a combination of codes, as can be seen on the Me.Firstname line, but when applied on the Me.Surname line it stops at the same place as the current code in the second example above
I keep getting Error 1004 'unable to get the VLookup property of the WorksheetFunction class"
Each code is on a different userform, the first userform is FrmPassword, and the second is FrmCNClients
thanks in anticipation!
Pete
Bookmarks