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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

text box and subform

Status
Not open for further replies.

rajcin

Programmer
Jan 5, 2001
1
MK
I have telephonebook.mdb with one table where I store dates for users.
I need one form with few text boxes and a subform, this form I want to use for searching users names, numbers, PINs,company info etc.
Is it possible to link for example [F/L name] text box with subform so when I enter character in text box, subform should display all names that starts with that character ( something like WIN index help )
Should I put some code behind OnChange event on text box,should I make antoher table or query for the subform and how I can link text box from the main form with the subform.
Thanks
Goran
 
Maybe this sample from is usefull
It is a sample for visual basic but it can't be difficult to port it to access.


'This project needs a ListBox, named List1 and a TextBox, named Text1
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Integer, ByVal lParam As Any) As Long
Const LB_FINDSTRING = &H18F
Private Sub Form_Load()
'KPD-Team 1998
'URL: 'E-Mail: KPDTeam@Allapi.net
'Add some items to the listbox
With List1
.AddItem "Computer"
.AddItem "Screen"
.AddItem "Modem"
.AddItem "Printer"
.AddItem "Scanner"
.AddItem "Sound Blaster"
.AddItem "Keyboard"
.AddItem "CD-Rom"
.AddItem "Mouse"
End With
End Sub
Private Sub Text1_Change()
'Retrieve the item's listindex
List1.ListIndex = SendMessage(List1.hwnd, LB_FINDSTRING, -1, ByVal CStr(Text1.Text))
End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top