Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Auto-fill text in a text box 1

Status
Not open for further replies.

KathyBRATS

Technical User
Apr 6, 2001
2
US
I have a textbox on a form with a control source from a field on a table called "Road Name". What I would like to do is have the form's user be able to start typing the name of a road and have Access autofill the rest of the road name, rather like the auto type function in Excel. Currently I have a control button set up to bring up the standard "Find" dialog. This works fine, but it just seems rather clunky. I JUST thought of a way to close the search form on LostFocus, but I would like to be able to do away with the Find Dialog box altogether.

Is there an easy way to accomplish this?

Present code is:

Private Sub cmdFindRoad_Click()
On Error GoTo Err_cmdFindRoad_Click


Screen.PreviousControl.SetFocus
DoCmd.DoMenuItem acFormBar, acEditMenu, 10, , acMenuVer70

Exit_cmdFindRoad_Click:
Exit Sub

Err_cmdFindRoad_Click:
MsgBox Err.Description
Resume Exit_cmdFindRoad_Click

End Sub
Private Sub Command23_Click()
On Error GoTo Err_Command23_Click


DoCmd.Close

Exit_Command23_Click:
Exit Sub

Err_Command23_Click:
MsgBox Err.Description
Resume Exit_Command23_Click

End Sub

TIA,
Kathy Brenner
Novice Extraordinaire
[:)]
 
Maybe just use a combobox? A combo box will autofill if it's in the recordset, and you can set it to accept new date if need?
 
Thank you! That does what I was looking for!

:) Kathy Brenner ~~ Novice Extraordinaire
Thurston County Roads & Trans.
CR-View Program ~ ITAA
 
How did you guys get the combo box to accept new data??

Thanks,
 
And set the LimitToList property properly.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top