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

Save selected record on form A into a different table

Status
Not open for further replies.

spassje

Technical User
Oct 25, 2002
4
0
0
BE
Hello,
I need your help. What I have is several tables but the problem I have now is:
I have a table in which I save (via a form) the offers we made to customers. What I want to do now is when a customer approves an offer to select this specific order and then save it into a different table called "confirmed orders". I don't seem to be able to figure out what to do. I tried making a query that makes a new table but that results in having all previous made offers into the table confirmed orders which of course is not what I want.
It might be stupid of me, but I've been breaking my head for over a day now on this issue and didn't figure it out yet....so please help.
Tnx!
 
Hi,

I guess you just need to Insert the offer into this table "confirmed orders" using vba... What does your code look like?


dj.

 
Well that's the problem I think I don't know anything about VBA....so untill now I didn't include any VBA since I don't know what to put there...
 
Oops,

well in that case, I would like to help you out a little, but then I need more information: what's the exact name of the table, the name of the field with the value you want to insert into the table, how you select an offer (is it by pressing a button or ...),...

dj.
 
I have one table called: offertes this table has following fields:
offerteID
klantID
artikelID_processor_select
artikelID_moederbord_select
artikelID_geheugen_select
artikelID_harde_schijf_select
artikelID_cd_select
artikelID_dvd_select
artikelID_vga_select
artikelID_geluidskaart_select
artikelID_speaker_select
artikelID_OS_select
artikelID_monitor_select
artikelID_printer_select
artikelID_scanner_select
artikelID_digitale_camera_select
artikelID_onsite_select
artikelID_modem_select
artikelID_netwerk_select
artikelID_toetsenbord_select
artikelID_muis_select
artikelID_extra_select

Via a form I make customized offers. Afterwards, when a customer approves an offer I would like to lookup the specific offer (which I do via a lookup field in a different form with blocked fields so that nobody can change the specific order) when I have selected the specific offer I would like to save this specific offer in a table called via a commandbutton: orders with the same field PLUS:
offerte_select (stands for the selected offer)
klant (customer whom the offer was made for)
klantadres (customerdetails)
klantpostcode (customerdetails)
offerte_verkoopprijs (offer subvalue)
totaal_prijs (offer totalvalue)

Hopefully this is enough to help you (or actually ME) otherwise let me know!
TNX SO FAR!
 
Hi,

I'm a bit confused about your tables and how they relate. (misschien zou het makkelijker zijn in het Nederlands ;-) )

Let me just give you an example of how to insert records into a table by pressing a command button.

----------------------------------------------------
Private Sub Command_Button_Click()
Dim con As Object
Dim stSql As String

Set con = Application.CurrentProject.Connection

'Toekennen van de offer aan de klant
stSql = "INSERT INTO tblOrders (offerteID ,... ,totaal_prijs) VALUES(" & Me.offerteID & ",..., " & Me.totaal_prijs & ") "

DoCmd.RunSQL stSql

End Sub
----------------------------------------------------

The values between brackets after tblOrders are the fields of the table tblOrders(die tabel met de bevestigde offertes). The values between brackets after VALUES are the values in the textfields on the form.


dj.

(Je kunt me anders altijd eens een mailtje zenden om wat Nederlandstalige uitleg hoor (djeeten_de_cerclezot@hotmail.com)).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top