|
-
May 24th, 2002, 08:43 AM
#1
Thread Starter
Frenzied Member
adodc simple question
I have a combo box (cboNumber), when something is selected in the combo box I want to update the form accordingly.
cboNumber, txtName and txtCompany are all linked to adoData, therefore when something is selected in cboNumber I want txtName and txtCompany to be updated.
I have tried:
Private Sub cboNumber_Change()
adoData.Refresh
End Sub
but keep gettin a system error, which closes the application
I know it's a simple query, HELP.
-
May 24th, 2002, 08:50 AM
#2
Frenzied Member
Code:
Public Sub cboNumber Click()
adoData.CommandType = adCmdText
adoData.RecordSource ("SELECT * FROM table1 WHERE field1 = '" & cboNumber.Text '")
adoData.Refresh
See how this works.
Being educated does not make you intelligent.
Need a weekend getaway??? Come Visit
-
May 24th, 2002, 08:57 AM
#3
Junior Member
Ok, so when you select something (ID Number?) in the combo box, you want it to go to the record and show the associated name and company?
I'll just throw this out there, though I could be way off track:
Code:
adoData.Recordsource = "SELECT Name, Company FROM TableName WHERE ID = '" & cboNumber.Text & "'"
adoData.Refresh
Where "Name" and "Company" are field names in your table called "TableName".
You may have a problem with your combo box being bound to your data control.
Anyway, it's a start.
**EDIT** Sigh, his is better above...
--Dador
-
May 24th, 2002, 09:13 AM
#4
Thread Starter
Frenzied Member
Thanks but I had tried that already and the ame thing is happening
When I go to chande the cboNumber it just bums me out of the application
-
May 24th, 2002, 09:29 AM
#5
Thread Starter
Frenzied Member
Actually when I have:
strSearch= "Select * From Table1 WHERE NumNo = '" & _
cboNumber.Text & "'"
With adoData
.RecordSource = strSearch
.Refresh
End With
I keep getting a Data Mismatch in Criteria Expression Error.
When I have:
The System bums out
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
|