Here are some screen shots in my effort to mimic finding an address from a number of addresses.
I have a sample of 440 addresses with City, Province and PostalCode.
The addresses are sorted based on the address line in alpha sort sequence.
Sample records........................................... .......addressrecords.jpg
Entering first character.......................................en tering_1...
Entering third character......................................ent ering_122...
Identifying a record from the list..........................identifying
Double click on the selected record......................doubleclick....
This involves a form, 2 textboxes and a listbox.
This is the OnChange event code for the top textbox text0
Code:
Private Sub Text0_Change()
Me.List2.Requery
Me.Refresh
Me.Text0.SelStart = Me.Text0.SelLength 'not sure this is needed, but I had it available
End Sub
This is the code for the dblClick on selected record
Code:
Private Sub List2_DblClick(Cancel As Integer)
Me.SelectedAddress = List2.Column(0) & ", " & List2.Column(1) & ", " & List2.Column(2) & ", " & List2.Column(3)
End Sub
This is the rowsource for the listbox list2
Code:
SELECT tbl_Spl_LCL_Std_EstAddressMailing.MailingAddr
, tbl_Spl_LCL_Std_EstAddressMailing.MailingCity
, tbl_Spl_LCL_Std_EstAddressMailing.MailingProv
, tbl_Spl_LCL_Std_EstAddressMailing.MailingPostalZip
FROM tbl_Spl_LCL_Std_EstAddressMailing
WHERE (((tbl_Spl_LCL_Std_EstAddressMailing.MailingAddr) Like [forms]![frmAddressLookup].[text0] & "*"))
ORDER BY tbl_Spl_LCL_Std_EstAddressMailing.MailingAddr;