Post unbound form data to table

eforce

Registered User.
Local time
Today, 10:42
Joined
Mar 25, 2002
Messages
44
What is the syntax to use on an "cmdUpdate" button if I want the data that was entered on a form with unbound fields to post to a specific table.

I'm told that i should never use a table as the direct record source from a form but I am having problems doing this any other way.

Its a data entry form that users fill out from their front end located on their PC. I want them to open up their form, fill in the data, then a connection would be opened to the SQL server and all their data would be transfered over into the table.

Data is validated as the user enters the info into the form. If that record is already present (primary key is SSN) in the table the new data would simply update the record and not copy over it.

Thanks,

Eforce!
 
Thanks Pat,
But how would I "add record", "edit record" ect.. if the form is bound to a query that fetches records from the table rather than the table that I want to add, delete, or edit to?.

Eforce
 
Dim SQLstr As String
SQLstr = "INSERT INTO orders ( id_order,money_def,note_def,orderfull)"
SQLstr = SQLstr & "VALUES ('" & Me.id_order & "','"
SQLstr = SQLstr & Me.money_def & "','"
SQLstr = SQLstr & Me.note & "','"
SQLstr = SQLstr & Me.orderfullID & "');"
CurrentDb.Execute SQLstr


'erase table order_details_temp
SQLstr = "DELETE * FROM order_details_temp"
CurrentDb.Execute SQLstr
 

Users who are viewing this thread

Back
Top Bottom