Hi,

I have two MS Access databases (Sales2006.mdb & Sales2007.mdb) and two Checkboxes (CheckSales2006 & CheckSales2007).

What I need is, when I Select CheckSales2006 I should get the data from Sales2006.mdb and when I Select CheckSales2007 I should get the data from Sales2007.mdb.

I have the code in a module like the following:

VB Code:
  1. Public Sub data_connect()
  2. Dim path As String
  3. path = App.path & "\[Highlight=VB]Database2006.mdb
"
db.CursorLocation = adUseClient
db.Open "Provider=microsoft.jet.oledb.4.0;persist security info=false;data source=" & path & ";"
End Sub[/Highlight]

How to modify the code accordingly?

Regards,

Margaret