Doing an Insert into a table from a form

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a form that I am doing some entry onto that has a List Box with a
facility name, and some other text boxes. I do some entry on the form that
is doing math to give me some final numbers to match up.

What I would like to do is take the following from the form and insert it
into the tbl.
Form:
Facility Name (In a list box),Invoice Nmbr,Invoice
Dt,Ttl_Sdl,Ttl_Plt,Ttl_Hndling,Ttl_Prcs,Ttl_Lding,Ttl_Strp,Ttl_Other

I would like to insert that data into the tbl. Tbl fields are:
Whse_Nm,Invoice_Nmbr,Invoice_Dt,Saddle_Hndling,Pallet_Cost,Storage_Hndlng,Loading,Processing_Fee,Strapping_Fee,Other

I started to write the following but it is not looking correct to me. Can
some one help?

StrSql = "Insert into Warehouse_Pricing (Whse_Nm, Invoice_Nbr, Invoice_Dt,
Saddle_Hndling, Pallet_Cost, Storage_Hndlng, Loading, Processing_Fee,
Strapping_Fee, Other)

After that I am lost on what to enter to get it to insert the info into the
table.
 
I figured it out.

StrSql = "Insert into Warehouse_Pricing " & _
"(Whse_Nm, Invoice_Nmbr, Invoice_Dt, SaddleBoom_Hndling, Pallet_Cost,
Storage_Hndlng, Loading, Processing_Fee, Strapping_Fee, OT_Labor, Other,
Total_Cost)" & _
"Values(FacilityName_T, Invoice, InvoiceDT, Ttl_Sdl, Ttl_Plt, Ttl_Strg,
Ttl_Ld, Ttl_Prcs, Ttl_Strp, Ttl_Ot, Ttl_Other, Ttl_Cost)"
DoCmd.RunSQL StrSql

Thanks for the help... That is making keep on trying unitl I got it.
 
Back
Top