|
-
November 26th, 1999, 12:26 PM
#1
Linking List Box to Text Boxes with ADO controls
We are struggling with data list boxes. We are trying to have the data in selected text boxes change to the current record source when a particular item is selected from a list box.
We are using the Biblio Database that comes the VB6 to prove it out. We have created a ADO connection and have the Titles as a list box and when we select a particular title we are trying to have 3 text boxes, (ISBN, Comments, Year Publilshed) update to the data associated with the selected title in the list box.
Any help would be greatly appreciated
Sean Gearin
[email protected]
978 975-9348
Thanks in advance
-
November 26th, 1999, 04:24 PM
#2
Re: Linking List Box to Text Boxes with ADO controls
Use Click event for Combo box to find the particulal Title:
private Sub Combo1_Click()
Dim strCriteria as string
strCriteria = "Title = '" & Combo1.Text & "'"
adoPrimaryRS.Find strCriteria
End Sub
Once you found the record, I think you do not have any problem to display needed fields in Text boxes.
This site displays my code wrong way. Single quotes are not comments. They are parts of code. Don't miss them.
Vlad
-
November 27th, 1999, 11:03 AM
#3
Re: Linking List Box to Text Boxes with ADO controls
I am getting error stating that the adoPrimaryRS Variable not defined. How do I define the adoPrimaryRS.
The name or our ADO connection is Adodc1 do I have to use that somewhere in that line. Also would this be the same for a list box rather than a combo box
Thanks for the help
Sean
[email protected]
-
November 27th, 1999, 03:06 PM
#4
Re: Linking List Box to Text Boxes with ADO controls
I thought you use ADO Recordset Object, not Data Control. The easiest to accomplish your task is to run Data Form Wizard. You can find it in Add-Ins menu in VB. When it will ask you about Binding type, choose ADO Code. Wizard will build the form for you. Make it as Start Up object, then add Combo, code I gave you. Or sent me your e-mail and I'll send you that small project as attachment. My address [email protected].
Vlad
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
|