adding records to a form need a code or how to

C

csumb

I am hopping someone can help me....

I am looking for a code or how to code

What I have is the following tables
products
order details
orders
customers

the relational links are as follows

customer to orders 1 to many [ customerID] to [ customerID]
orders to order details 1to many [order id] to [order id]
order details to products 1 to many [productsID] to [products ID]

right now i have a combo box in the sub order form called product that adds
the product to the order

what i would like to do is get rid of the combo box

and pull up the product form (listing all the products with a pic of the
products)
and enter the quantity that the customer wants and have it add it to the
customers order and then be able to save it for future reference

This shouldnt be to hard but iam new at this and am not sure how to
accomplish this

Can someone please help me on how to do this or were i can go to get the
answer

thanks.
 
K

Klatuu

It is not as easy as it looks unless you are familiar with using VBA and
understand the Access Object Model a bit.

The basic concept is you have to have a command button or some control to
use to send the info on the current product record to the order form. It
would be like using the combo as you are now, only in reverse.

You will, of course, need a control on the product form to enter a quantity.
To add it to the order, I would suggest using the After Update event of a
command button.
What you need to do is:

1. Be sure the order form is open (not the subform, you can't tell that)
2. Create a new record in the order subform
3. Update the controls with the product code, quantity and price.
4. You also have to update the extended price control on the subform.
Calculated controls do not recalculate if the values are changed
programmatically. If you currently have any event code in the subform
controls, you will need to move that code to the product form. The same is
true for other events like Before Update, After Update, etc. They only fire
when the values are changed manually.

So, that's pretty much how you do it.
 

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