Error trying to link up Combo and Text boxes 
Author Message
 Error trying to link up Combo and Text boxes

Where am I going wrong? I am trying to have the list item I select
show up in a text box. Right about where the name of my recordset is
(datData2.Recordset.FindFirst strCriteria), I get a variable not
defined(datData2. is blue in Debug, the sub name is yellow). I can't
even figure out how to define a Recordset or a DataControl. Should I
be using a DBList box, or populating a combo box with .AddItem?

Private Sub DBCombo1_Click(Area As Integer)
Dim CustomerID As String
Dim strCriteria As String
strCriteria = "CompanyName'" & DBCombo1.Text & " ' "
datData2.Recordset.FindFirst strCriteria
txtAccount.Text = dataData2.Recordset(CustomerID)
End Sub

Sun, 27 Aug 2000 03:00:00 GMT  
 Error trying to link up Combo and Text boxes

Sub name highlighted in Yellow tells us that the sub won't compile because
of the error.

Variable not defined and highlighting Data2 shows that you don't have a data
control called Data2 on your form.

If you don't know about DataControls and Recordsets then you need to read
the VB Programmers Guide - Chapter 14 Pages 675-711

To start with you are probably better off using standard ComboBoxes rather
than dbCombos.

Simon Jones
PC Pro Magazine

Sun, 27 Aug 2000 03:00:00 GMT  
 [ 2 post ] 

 Relevant Pages 

1. Error trying to link up combo and text box

2. Error trying to link up Combo and Text boxes

3. Error trying to link up Combo and Text boxes

4. Vb 4.0 Problems updating Text Boxes from Combo Box linked to Data Control

5. Error trying to populate a combo box

6. Linking feilds in a combo box to different text feilds

7. link combo box with text

8. Linking VB text box to powerpoint text box

9. 2101 error when trying to set Left property on text box

10. Limiting Access to Text Boxes, List Boxes and Combo Boxes

11. creating a text box errors message for empty text box

12. Unable to populate text box from combo box


Powered by phpBB® Forum Software