0

Can anybody tell me.How should i get value on the basis of combo box.i simple want when user click one of the productname from the combo box other corresponding fields from the database should come in the text box of the form.Here is the code what i have written.kindly help me.any help would be greately appreciated.right
now i am getting runtime error 3709.

Private Sub Combo3_Click()
If Combo3.Text <> "" Then
Set rs = New ADODB.Recordset
rs.Open "select materials.unit from Materials Where Materials.productname=" & Combo3.Text & ", con,adopendynamic,adlockoptimistic"
TxtUnit.Text = rs!Unit
End If
End Sub
2
Contributors
1
Reply
2
Views
7 Years
Discussion Span
Last Post by QVeen72
0

Hi,

If Product Name is String, then Wrap it with Single Quotes :
Try This :

Set rs = Nothing
Set rs = New ADODB.Recordset
rs.Open "select materials.unit from Materials Where Materials.productname='" & Combo3.Text & "'",  Con
' Rest of Coding Remains Same
'

Regards
Veena

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.