Is there an easy way to add a table to the record source to a Form that is already created?
In my example I have a form that uses all the info from the "Invoices" table. This table has the field "Customer ID" What I want to do is use the customer ID to get the customer name from the "Customer" table and display it in this form.
Now I what i should of done is created the form with the 2 tables using the wizard and it would of worked but I don’t want to do that way. I want to know how I write it so that I can bring in the new table after I have created it. At the moment the record source is just "invoices". I created a second test form that uses the both tables and I get a record source of ....
"SELECT Invoices.InvoiceID, Invoices.InvoiceNumber, Invoices.CustomerID, Invoices.Status, Invoices.InvoiceDate, Invoices.Amount, Customers.CompanyName FROM Customers INNER JOIN Invoices ON Customers.CustomerID=Invoices.CustomerID; "
but is there an easier way of doing this. Writing something like "Invocies + Customers" in the records source section instead of the select statement?
In my example I have a form that uses all the info from the "Invoices" table. This table has the field "Customer ID" What I want to do is use the customer ID to get the customer name from the "Customer" table and display it in this form.
Now I what i should of done is created the form with the 2 tables using the wizard and it would of worked but I don’t want to do that way. I want to know how I write it so that I can bring in the new table after I have created it. At the moment the record source is just "invoices". I created a second test form that uses the both tables and I get a record source of ....
"SELECT Invoices.InvoiceID, Invoices.InvoiceNumber, Invoices.CustomerID, Invoices.Status, Invoices.InvoiceDate, Invoices.Amount, Customers.CompanyName FROM Customers INNER JOIN Invoices ON Customers.CustomerID=Invoices.CustomerID; "
but is there an easier way of doing this. Writing something like "Invocies + Customers" in the records source section instead of the select statement?