Enter data using Form and VBA Code

WhizzkidWallace

Registered User.
Local time
Today, 16:05
Joined
Jan 10, 2005
Messages
49
Hi,

I am sure this will be childs play to many, but its my first time trying to get data into a table from an unbound form. There are several unbound text boxes on the form, and certain data needs writing to different tables. Sometimes its amending an existing records, and sometimes creating a new record.

I guess I leave the form open, and attach the code to an 'Accept' or something button, which then opens a recordset from each table in turn, and writes the data into it. How do I do this?

Thanks for your help anyone.
 
Most of us could probably use a little more data. i.e. table structure, form structure, relationships, and exactly what needs to go where.

But overall, I would say that you will probably end up using SQL statements to modify the tables you want.

Probably, this might be a little inefficient for some things. Whats the main reason the form can't be bound to at least one table?
 
Thanks. Surely though its a fairly routine thing to want to do. I thought I might use Sql to do it, but how?

I know about the INSERT into Sql code for adding records, buy what about the Sql code to modify fields of an existing record?
 
To modify a record use:

UPDATE table SET record = whatever WHERE record = the textboxes;

Do a search for SQL commands and you will find tons of info regarding this. If you need more info. just reply with some infomation about your form and table structure, etc. and I will see what I can do to help.
 

Users who are viewing this thread

Back
Top Bottom