Paramterized appends query

K

Kirk Cullen

How can you run a parameterized appends query from vb
using a form field as the criteria???
 
S

SFAxess

Kirk,
Is this an .adp/.ade or .mdb/.mde?
If it is a stored procedure in SQL Server,
You can use code like this from a Command Button on a
form:
Example: Your form is named frmEmployees and the criteria
you want is in a text box named txtEmployeeID. The stored
procedure is named "spAppendRecords"

Private Sub CommandButton1_Click()

CurrentProject.CurrentConnection.Execute "EXEC
spAppendRecords '" & me.txtEmployeeID & "'"

Exit Sub

For a Jet query (Access .mdb) you can put the following
as the criteria of the field in question:
Forms!frmEmployee!txtEmployeeID
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top