Posting Auto Form Data to Tables (1 Viewer)

R

RWPerkinsJr

Guest
I am trying to make a Invoices Database that uses a combo box to relay information to a text box from a table I created named Part Numbers. All works great except the text box will not save any form data to the table. I am using 2 columns in the combo box. The Part Number I want to store is in column 0 the description is in column 1. I find the PN (Part Number) I want and click it. The database saves the part number in my PN1 in the table. In the text box I use:=[pn1].[column](1) in the control source. Since My part number is in column(0) and the description is in column(1) I get the right result but the description will not save to my D1 field in the table. Can anyone help me? Please?

.
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 07:52
Joined
Feb 19, 2002
Messages
43,266
The description should NOT be saved to the table. Any time you need it you can add a join to the Part table to get it. This is what relational databases are all about.
 
R

RWPerkinsJr

Guest
I do need it in my table so I can make Reports that have all the information on them. I am new to this and still trying to get the relational part of this. In my reports I can get all the information from my main database EXCEPT the description. Therefore I assume I am going about it the wrong way or I need to use different code in After Update or something like that. I want ALL of the information stored in the Main database.

RP
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 07:52
Joined
Feb 19, 2002
Messages
43,266
No you don't need it in your invoice table. You simply need to know how to obtain it when you want to display it. The problem is with the recordsource for the report. Make a query that joins the invoice table to the part table. Select all the columns that you want on the report from the two tables and save the query. Then change the recordsource for the report to be the new query rather than the invoice table. You will then have the description field in the report's recordsource (along with all the other fields) so you can place it on the report.

Forms and reports should generally be based on queries rather than tables anyway.
 

Users who are viewing this thread

Top Bottom