Running a Multiple Paramater Query using VBA

aziz rasul

Active member
Local time
Today, 14:56
Joined
Jun 26, 2000
Messages
1,935
Details:
On a form, I have a combo box that contains a hundred unique numbers. When I select a random set of numbers from the combo box, they are transferred to an empty table (tblSelected LOPID's).

Question:
How do I run a parameter (append) query using the above chosen numbers in the table, using the DoCmd.OpenQuery method.

Attempted Solution:
I tried to refer to the field in the table, in the parameter query but it didn't work e.g. [Tables]![tblSelected LOPID's]![LOPID].
 
Aziz,

I used the following sql statement in my code. It get's a value from a form and it works great:

("SELECT * FROM " & afdeling & " WHERE verwijderen = -1")

another example:

("Select * From tblnaam Where vaknummer Like '" & forms![formname].[controlname] & "*';")

Hope i understand your problem, and this examples will help you.

Albert
 
I'm afraid I'm not SQL fan. From what you have written, does this represent an append query?

I have managed to potentially find a way of solving the problem by using a list box on the form. The list box contains all the numbers that I want in the parameter query. The question is how to select each number from the list box turn by turn and hence run the query that way.

[This message has been edited by aziz rasul (edited 11-15-2001).]
 
Thanks David. I'll look into that. If I have any further problems, I'll post back.
 

Users who are viewing this thread

Back
Top Bottom