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

Change RecordSource

Status
Not open for further replies.

chrsab

Programmer
May 24, 2002
44
GB
Hello

I am wanting to be able to change the RecordSource of a DataField while the program is running. The aim is that a combo box is displaying a list of databases in a folder and for the user to select the database from that list. So then the RecordSource will display that database, for it to be searched.

But all attempts i have tried clears the DataField and displays nothing. So i am guessing that it doesn't recognise what i am trying to make it do.

Thanx for any help you can provide.
 
Could you show your code for populating and clearing the DataField?


I used to rock and roll every night and party every day. Then it was every other day. Now I'm lucky if I can find 30 minutes a week in which to get funky. - Homer Simpson
 
Sorry it is the DatabaseName i wish to populate but with the following code, it only clears the DatabaseName.

Dim selected as string

selected = Combo1.List
Data1.DatabaseName = selected

My Combo1.List is populated with the mdb files from a folder, which when selected needs to be inputted into the data1.databasename.

Thanx
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top