Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Access Table Help Needed

Status
Not open for further replies.

vince99

IS-IT--Management
Mar 1, 2001
63
US
Thank you in advance for your help.....

I have 2 tables that I have made:


1) Main fields: product and price
2) Products fields: product and price

What I want to do is create a form with a combo box
that I can choose products, and have access fill in
the price field. After that I would like the info
to be stored in the Main table.

How can I do this? I have very little experience and
any information will be helpfull.....

Thanks again
 
In the underlying recordsource for your form include BOTH tables. Join the tables with the product ID. Double click the join line and change it to include ALL records from the Main table and only those matching from the Products table. Now place all the fields from the main table on the QBE grid and the Price field from the product table(this add the price from the products table to the underlying recordsource thus speeding up transfer of this value to the field in the main table when a product has been selected). In the AfterUpdate event procedure of the product control add the following:

Me.MainTableName.Price = Me.ProductTableName.Price

I've included the table names because it appears that both fields have the same name. If their names are not identical then you dont' need the tablename qualifier.
 
how can I include both tables on one form
 
Also when I type in the Me.Main.price = me.products.price

I get an error regarding the "me"
 
Simple fix on the last one: "Me." is the main, so should be written as Me.price . Gord
ghubbell@total.net
 
To add the other table to your recordsource, click on the '...' next to the recordsource property. If the form is based on a query it'll open that query. If not, it will create one for you. I suggest you drag the "*" from your main table to the QBE grid. Add the second table. Add the join line. Change the link type. Then place the price field on the QBE grid. It's now a field in your field list, and as such is part of the underlying recordset. It won't have any value until you select a product(the link).
 
I know this might sound crazy, but I cant find the
recordsource anywhere !!!!!!

Can you help
 
Vince99: Form design view, double click on the black square top left corner of the form design screen which will bring up the forms properties. Select the data tab, click on record source once and you will see a small arrow down button and to the right of that the ellipse "..." button. from there follow Jerry's steps. Gord
ghubbell@total.net
 
Ok Thanks for the tip.....

I have done everything as you said, but when I enter the

Me.MainTableName.Price = Me.ProductTableName.Price

in the after update of the conbo box (product) i get this

error :

The expression after update as the event property setting
produced the following error: The object doesnt contain the automation Me
 
Look at the names of both the combo you are "sending" from and the field that is receiving. Jerry has given you an example and I suspect you have taken it literally. On the events tab move to the after update event. using its arrow button click and select "event procedure". Once this is selected click on the ellipse "..." right beside. This will open the visual basic environment and label up a sub for this event. Start by typing Me , add a period and you will be offered a list of things to chose from. scroll through the list until you find the name of the "sending" control. select it and add = then add Me. again to select the name of the receiving control. Close the VB environment, and try your form. Gord
ghubbell@total.net
 
Thanks guys!!!!!!

I really appreciate all the help!!!!!

I have figured it out (Thanks to you guys)

so I am on my way


THANKS AGAIN

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top