Parameter query (too few parameters)

J

jeb

I have a form in which the users enter the parameters for an append query (a
combo box and a text box). I wanted to try running the query in code but it
doesn't seem to know about the form. The code is this:

Dim cmd as ADODB.Command
Set cmd = New ADODB.Command

Dim rst As ADODB.Recordset

With cmd
.ActiveConnection = CurrentProject.Connection
.CommandText = "qryDatePrimary"
.CommandType = adCmdStoredProc
.Execute
End With

What do I need to add to tell it about the parameters on the form? Also,
when I split the database and the query uses a linked table, will I need to
change the connection? Thanks!
 
Top