Hello, I am currently working on a workbook that accepts various information from a user via a userform and adds it to an acces database. My problem is that I do not know how to get to this file with the connections. Currently, I have:
Sub AddTransfer(Style As Variant, FromStore As Variant, _
ToStore As Variant, Qty As Integer)
Dim cnn As ADODB.Connection
Dim rst As ADODB.Recordset
MyConn = "C:\Inventory Records.mbd"
' open the connection
Set cnn = New ADODB.Connection
With cnn
.Provider = "Microsoft.Jet.OLEDB.4.0"
.Open MyConn
End With
' Define the Recordset
Set rst = New ADODB.Recordset
rst.CursorLocation = adUseServer
I am running this in Module1, but it either gives me an error or makes me run a different Macro. Any ideas what I should do?
Bookmarks