Can a command button macro run a make-table query with an auto-inputted parameter value?

5 pts.
Tags:
append
Control
Form
make-table
parameter
Query
run
SQL
value
where
I want to run a make-table query with a parameter, using a command button click event on a form showing a single record. The parameter value needs to be inputted automatically using the value of a control in the current record of the same form. Can this be done with a macro event? If so, what does the macro look like? If not, how do I express the WHERE clause of the SQL statement which would run the query in a VBA sub procedure attached to the button? Details: I've got a customer orders table and a customer order details table. The customer order user input form shows records from the customer order details table as a subform, with the customer order ID as the linking field. After the details are inputted, I want to post those details to a stock movements table, but need to do some sales unit conversions along the way. So I'm trying to run a make-table query which, besides doing some unit and price calculations, only creates records for the current customer order, and then to run an append query which appends these cooked details from the temporary table to the stock movements table (which exists to record the ins and outs needed to create a current stock level for each inventory item). I tried to append to the stock movements table directly from a select query which did the order details unit conversion calculations , but couldn't get calculated query fields to match up with the destination table fields. Thus the make-table query intermediate step, which needs a parameter so that it doesn't recreate the entire customer order details table (potentially infinite in length) each time it runs.
ASKED: July 28, 2009  11:46 AM

Answer Wiki

Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following