Autofill into Tables (from Forms)

SteveI

Registered User.
Local time
Today, 17:29
Joined
Apr 22, 2012
Messages
20
How does one autofill into a table from a form. Can anyone assist. DB attached.
tx
S.
 

Attachments

It does sort of, thanks. But I still cannot seem to get the information that appears in the text box in the form to drop into the actual table. I have tried the following code as suggested, but it does not seem to work - or I am not sure where I am supposed to insert it...

Me.TextboxName = Me.ComboName.Column(2)
 
You would insert it in the after update event of the combo, and the textbox would need to be bound to the table.
 
table1 needs a better name and it needs a primary key. I don't know how the RI table fits into the picture. The current structure looks like table1 is related 1-1 with Formula. That is probably incorrect.

I don't know what you are trying to copy from one table to the other but the ONLY common fields should be the foreign keys. The FKs are used to link the tables so you can get related data.
 
Thanks I will rename and give it a primary key.
The RI Table contains the ingredients to make the formula/recipe hence the reason I need to pick up from the RI Table and drop into the Subform via autofill (Table1). The Formula Table is the main table that contains all the details about the recipe/formula.
 
I'm not quite sure what you are trying to do. I looked at the schema and it doesn't make any sense to me. I'll describe an application I built and you can tell me if that is what you are trying to do.
The company made hair care products. The basic formula was stored in two tables (header and detail). When we needed to make a batch, the user specified the batch size and I took the formula data and copied it into a second set of tables multiplying the formula percentages times the batch quantity to get the quantity for each chemical in the formula. Transferring the formula to the batch was done with an append query that contained a calculated field so that the batch table contained an actual quantity rather than a percentage.
 
Thanks. It is what I am trying to do. The only difference is that I need to open the header and then formulate a product - I do however need the autofill to pick up in the detail section to copy into the table1 which is linked to the formula table via ID2-ID. - i.e. I need to select the ingredients as I go along i.e. formulate a paper formulation and then take it to the lab to manufacture (forms will take care of this). I am just struggling with the relationships and autofill.

The Formula table in my db is what I am trying to achieve from a surface level.

thank you for your help.
 
I am not sure if you are using the term "autofill" correctly. Access never automatically copies data from one place to another. However, it is quite easy to "show" data that exists in a separate table. To do this, create a query that joins tbl1 with tbl2. Use that query as the RecordSource for the form or report. You can choose columns from both tables. So in this example, tbl1 would hold the componentID and quantity and tbl2 would hold the description. Your form would show both but the "description" would not be copied into tbl1. There is no need for that.
 

Users who are viewing this thread

Back
Top Bottom