|
-
March 30th, 2001, 10:12 PM
#1
Help with code to fill text boxes
Hi,
I have an address database with the Field ID as the primary key, I have managed to load by code a combo with surnames.
What I want to do is load textboxes, such as address and suburb from the DB which correspond to the name when selected in the combo.
Any sample of code to do this is appreciated.
Regards,
Alan.
-
March 30th, 2001, 11:45 PM
#2
Re: Help with code to fill text boxes
Use the FindFirst method with the ComboBox text in the criterion to lacate it in the recordset. Then use the Fields method to load the appropriate field into a textbox.
-
March 31st, 2001, 01:32 AM
#3
Re: Help with code to fill text boxes
Hello:
You can try this code if you using ADO to get your DB NAME is a column number
Private Sub Command2_Click()
Adodc1.Recordset.Find "NAME=" & "'" & Combo1.Text & "'"
End Sub
Private Sub Command3_Click()
Adodc1.Refresh
End Sub
I hope this answer your question. If you need more help, please reply
-
March 31st, 2001, 01:37 AM
#4
Re: Help with code to fill text boxes
Hello:
I forgot to mention to you. To set textboxes, you set datasource to the ado or dao object and then set datafield to your field.
Good Luck
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|