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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using INSERT INTO to enter a set list of records into a Join Table 1

Status
Not open for further replies.

alanna101207

Technical User
Oct 26, 2007
13
US
I don't know if this is the proper way to approach this, but with my limited knowledge of access, this is all I can think of. This is very detailed, so please bare with me.

I have 2 tabels "tbl_Charges" and "tbl_Rates" with "ChargeID" and "RateID" being the primary keys. The "tbl_Charges" has a set of Charges for items such as Delivery Charge, Rush Charge, Document Prep Charge etc...each client has a different set of rates...ie..."Standard Rates", "VIP Rates" etc...

In order to join these 2 tables I used a Join Table "tbl_RatesChargesJoin". This needed it's own primary key "RateChargeID". I need this to insure Integrity the way I have it set up.

I have a form (frm_NewRates) that I am building that will be for a manager to enter new rates. He opens the form, clicks a command button that starts the record with a new "RateID". He then has to enter a new "Rate Name". I want to have a Command Button or something that would be clicked, and then automatically populate the sub form with each Charge from the "tbl_Charges". He then would only have to enter the amounts next to each charge that is already there in the "frm_NewRates" subform which has a record source of the "tbl_RatesChargesJoin".

After the research I have done on Access I have decided to try to use the INSERT INTO code to do this, this would add new records in the join for each charge, however, doing this from a form seems more difficult than I imagined mainly because of the quotations I believe. It looks like I would need to use INSERT INTO, then SELECT or VALUES...just not sure.

Could somebody point me in a better direction, if there is one, or point me to an article or post that tackles something similar to what I amtrying to accomplish. Thank you very much.



 
How are ya alanna101207 . . .
alanna101207 said:
[blue]It looks like I would need to use INSERT INTO, [purple]then SELECT or VALUES[/purple]...just not sure.[/blue]
Use [blue]VALUES[/blue] to insert a single record . . . [blue]Select[/blue] to insert multiple records!


Calvin.gif
See Ya! . . . . . .

Be sure to see thread181-473997
 
alanna101207 . . .

Hit submitt too soon.

Depending on criteria in the query/SQL, a [blue]single or multiple records[/blue] can be inserted . . .

Calvin.gif
See Ya! . . . . . .

Be sure to see thread181-473997
 
Thank you. I am going to give it a crack using SELECT since it is multiple records, but I may be back with some help with the quotations on this since I will be using this code from a text boxes after_update event on a form.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top