Dear All,
I have a
Mainform: REPAIRSMAINFRM
With a subform: REPAIRSSFRM
Whose record source is a Table: REPAIRSX
On the Mainform I have an unbound Text box called TEXTLOOKUP
I am trying to use it as a way of navigating through records in REPAIRSSFRM which is a Datasheet, by using the AFTERUPDATE event to set the focus on the subform REPAIRSSFRM to the first record that agrees with the text the user has typed into TEXTLOOKUP.
I got the following code in thread702-1176848 from HandsOnAccess and adapted it to my circumstances but it doesn't seem to work and as HandsOnAccess has unmarked that thread (having answered the original question to another person), I am posting my question as a new thread.
I would prefer it to scroll down the subform as I add the characters to TEXTLOOKUP.
I appreciate any input as I have got a little rusty!
Thanks in advance.
Jim
I have a
Mainform: REPAIRSMAINFRM
With a subform: REPAIRSSFRM
Whose record source is a Table: REPAIRSX
On the Mainform I have an unbound Text box called TEXTLOOKUP
I am trying to use it as a way of navigating through records in REPAIRSSFRM which is a Datasheet, by using the AFTERUPDATE event to set the focus on the subform REPAIRSSFRM to the first record that agrees with the text the user has typed into TEXTLOOKUP.
I got the following code in thread702-1176848 from HandsOnAccess and adapted it to my circumstances but it doesn't seem to work and as HandsOnAccess has unmarked that thread (having answered the original question to another person), I am posting my question as a new thread.
Code:
Private Sub TEXTLOOKUP_AfterUpdate()
If Not IsNull(me.TEXTLOOKUP) = True and Len(Trim(me.TEXTLOOKUP)) > 0 Then
If Not IsNull(Dlookup("CUSTID","REPAIRSX","[LAST_NAME] = '" & me.TEXTLOOKUP & "'")) = True Then
me.REPAIRSSFRM = Dlookup("CUSTID","REPAIRSX","[LAST_NAME] = '" & me.TEXTLOOKUP & "'")
Else
Msgbox "Last Name Not Found.", VbCritical,"User Alert"
Exit Sub
Endif
Endif
End Sub
I would prefer it to scroll down the subform as I add the characters to TEXTLOOKUP.
I appreciate any input as I have got a little rusty!
Thanks in advance.
Jim