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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Set RowSource for the combobox using the Query Result or values list

Status
Not open for further replies.

cogivina

Programmer
Jun 3, 2003
36
US
Hi,

I would like to set the RowSource for the ComboBox in the form in Excel in one of the two ways:
-------------------------------------------
1) using the result from the query in access.

With frmData
STRquery = " SELECT Acct FROM myTable GROUP BY Acct"
Set rstData = dbName.OpenRecordset(STRquery, dbOpenSnapshot)
.Acct.RowSourceurce.CopyFromRecordset rstData (????)
.Show
End With
--------------------------------------------
or
-------------------------------------------
2) just list the values without using the creating a range name in worksheet.

With frmData
.Acct.RowSource = "1,2,3,...,12"
.Show
End With

Thanks.
 
Can't you use the GetString method of the ADODB.RecordSet object ?

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Hi PHV, I'm not sure how to put these codes together.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top