Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Setting the RowSource Property of a DBCombo control from code

Status
Not open for further replies.

doneg

Programmer
Jul 20, 1999
7
US
I am trying to set the RowSource property of a DBCombo box from code. The DBCombo control name is dbcSource. The data control name used with this control is dtaSource. Selection dtaSource from the properties box works fine. But this line returns a Type Mismatch error:<br>
<br>
dbcSource.RowSource = &quot;dtaSource&quot;<br>
<br>
Once again, any help here would be appreciated.
 
Not sure what you want to do...<br>
But<br>
I tried several things and this works<br>
<br>
Connect the DBCombo box to a Data Source<br>
In my Example It's Data1<br>
then Change the RecordSource of the Data control to what ever.<br>
I used the Biblio.mdb database and &quot;Title Author&quot; table<br>
Now when you change the RecordSource of the Data Control the ComboBox will automatically change to match.<br>
<br>
Data1.RecordSource = &quot;Select Au_ID From [Title Author] Where Au_ID = &quot; & Me!Text2<br>
Data1.Refresh<br>
<br>
I used a Textbox to to test the code <br>
I changed the value in the text box and and it did get new values in the combobox<br>
<br>
<br>
<p> DougP<br><a href=mailto: dposton@universal1.com> dposton@universal1.com</a><br><a href= > </a><br>
 
Ok, Thanks Doug.<br>
<br>
I'll give this a try.<br>
<br>
Don
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top