Public Sub ShipmentRequest_Click()
I am trying to be able to access records from another database table, from
the one that I am currently in. This is the code that I have so far that
allows me to change the recordset to the one that I need, but What I need to
know is how to change it back. I have tried using the same code to change it
back with a different strSQL name(the table name of the data I originally
used) but that does not seem to work. I am not opposed to getting the data
from the second table a different way, but I am at a loss for ideas as
nothing seems to work well.
Thanks in advance
Dim cnnCustomerdbnew As New ADODB.Connection
Dim customerdbnew As New ADODB.Recordset
Dim strSQL As String
With cnnCustomerdbnew
.Provider = "Microsoft.Jet.OLEDB.4.0"
.Open "\\Backup\hosted files\CustomerDatabase\customerdbnew.mdb",
"admin"
End With
strSQL = "customerdbnew"
With customerdbnew
Set .ActiveConnection = cnnCustomerdbnew
.CursorType = adOpenKeyset
.CursorLocation = adUseClient
.LockType = adLockOptimistic
.Open strSQL
End With
Set Me.Recordset = customerdbnew
(or if you know of any way were I don't set the recordset, but I still can
access the fields inside the new table that would also work (better if
possible))
--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...ccess/200508/1