pupulate a combobox with a table on different file that where Iam

Iceman Solope
10-12-2004, 10:01 AM
Hi there,

I have a little problem with access 2002, I have a combobox and this combo is populate by dates stored on a table, all seems fine, but the problem is that the table that populate this combo is in other access file.

when the table was in the same file that the form I just use the SQL query generator and make me this sql

SELECT DISTINCT tblTarifas.dates FROM tblTarifas ORDER BY tblTarifas.dates;

But somebody know how can I tell to Access that tblTarifas are on a different Access file?

any suggestions I'll appreciated it

10-12-2004, 10:48 AM
from the menu

File -> Get External Data -> Link

pick the Other MDB, and then choose the Table in question

10-12-2004, 06:34 PM
If you are looking for a dynamic, programmatic way to get data from another database, you can use an sql statement. You can implement the Jet 4.0 Provider and conduct a query such as:

"SELECT DISTINCT [dates] FROM [MS Access;DATABASE=C:\mydb.mdb].[Dates] ORDER BY [Dates]"

Now, if you need a link to the actual database (meaning you need to do more than one query and consistently work between both databases), you can use the ADOX to programmatically link two mdb files, etc.

Iceman Solope
10-18-2004, 11:32 AM
Thnks MKoslof I try to use this SQL, but It doesn't work, the SQL Builder say that is not a valid SQL Instruction :whoops:

So this is my last code that call tblTarifas.fecha from my actual mdb file, and I want to be an external mdfile that is in C:\Documents and Settings\DAVIDG\Escritorio\new6 directory

SELECT DISTINCT tblTarifas.fecha FROM tblTarifas ORDER BY tblTarifas.fecha;

Thnks for post

10-19-2004, 05:18 PM
That sql script should work fine, I use it all the time :). Can you show me the code you used to implement this?

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum