Text Bow from one table adding to another table

extremeshannon

Registered User.
Local time
Today, 00:43
Joined
Aug 28, 2019
Messages
24
Hello all,
I am creating a Maintenance log DB and need my form to write to the logbook table.

I have created a form that on one side you choose a customer. On the other side you choose on of the items assigned to that customer. I display them with a text box. I would like to put a button that will write to my logbook table.

Shannon
 
In the button event code, run an APPEND query or the SQL equivalent
INSERT INTO TableName (Field1, Field2....) VALUES ...
 
I have been beating my head all day on this. I have created an INSERT statement and it does work. When I put in a Query there are pop up boxes when it runs. Whether I run it on the form or just run it. How can I make this actually grab the info off the form that is there and INSERT into Database.

Thanks again for all the help
Shannon
 
You can have query object reference controls on form or have VBA execute INSERT action.

I wonder why you are not just using a form bound to logbook table.
 
I do have the Form Bound to the table. The Combo Boxes and date boxes do put the values in. The text boxes that are being pulled from several sources are not. I am looking for a simple way to insert all the info I have showing up on the form.

Shannon
 
Form bound to table, controls bound to fields, data entered into controls will save directly into table without code.

If you would like to provide db for analysis, follow instructions at bottom of my post.
 
Here is my DB. The Form i am working on is frmLoftRecord.

I have bounded tblLoftRecord2 to it and change all data fields to short text. The Original table is tblLoftRecord

I do have lots of clean up to do. Any feed back is welcome.

Thanks
Shannon
 

Attachments

test this one
it is saving to local table at
a moment. just go to the code
and uncomment your dbs and
comment out my dbs.
 

Attachments

Thanks for the help that gives me a great building block to make the form work.

Thanks
Shannon
 
happy coding.
 
test this one
it is saving to local table at
a moment. just go to the code
and uncomment your dbs and
comment out my dbs.

These 2 Parameters are not going into the DB. These are the ones I have been having a problem with.

.Parameters(1) = Me!txtResMan
.Parameters(2) = Me!txtResModel

Shannon
 
local db or your remote db.
on local db you can browse tblLoftRecord, on the bottom.
 
I have it in the local DB. It does allow you to use the records navigator to see it. But those fields are referencing the Rig # and pulling the data. I need for SQL statement to put them in the LoftRecord table. I do not want them changed when a rig part is changed.

Shannon
 
It does work. I was looking at the table the form was bound to and not what was in the VBA script. Now what I need help with is the items on the form that are bond to a field create a record and the ones in the SQL create another one. So 2 records are created each one has half the info.

I will keep trying any help would be great.

Shannon
 

Users who are viewing this thread

Back
Top Bottom