There are several ways to pass parameters to Access. How you do depends on whether you are using DAO or ADO to access the database. That is the first thing. One possible solution is to create a parameterized query in access and pass the parameters to the query. Here is a code snippet using ADO to pass two parameters:
Dim cmdQuery As ADODB.Command
Dim rstInfo As ADODB.Recordset
Dim prmQuery As ADODB.Parameter
Dim i As Long, lTemp As Long
Dim dv As Date
Set cmdQuery = New ADODB.Command
With cmdQuery
.ActiveConnection = cnnToDB
.CommandText = "StoredParameterizedQuery"
.CommandType = adCmdStoredProc
Set prmQuery = .CreateParameter("ID"

With prmQuery
.Direction = adParamInput
.Type = adInteger
.Value =ID
End With
.Parameters.Append prmQuery
Set prmQuery = .CreateParameter("AnotherOne"

With prmQuery
.Direction = adParamInput
.Type = adChar
.Size = Len(Text)
.Value = Text
End With
.Parameters.Append prmQuery
End With
Set rstInfo = New ADODB.Recordset
With rstInfo
.CursorType = adOpenKeyset
.LockType = adLockOptimistic
.Open cmdQuery
.
.
.
End With
Note: with ADO you need to specify the cursor type in order to write to the database. The deault is a forward only cursor which does NOT allow you to write to the database.
Hope this helps some. Dan Grogan
dan@siqual.com
"Absit prudentia nil rei publicae profitur."
Without common sense you ain't gonna have nothing.