Form With Subform Problems

Drayloc

New member
Local time
Today, 16:46
Joined
Nov 14, 2011
Messages
6
I am having some problems with my Orders form (Picture Attached). Every time I enter an order, or set of orders onto it the Company Name, Order Ref, Job Number, Order Date & Delivery Date are on a separate line to everything else. Is there anyway to get them on the same line and have the Company Name, Order Ref, Job Number, Order Date & Delivery Date copied to each item ordered?
 

Attachments

  • Print 1.jpg
    Print 1.jpg
    72.4 KB · Views: 85
Drayloc,
You have a little design issue first. The company information should be in a company table like this:
tblCompany
CompanyID, CompanyName, CompanyAddress, etc.
On the form you put a combo box with the company table as its source and the combo is bound to the CompanyID
When you open this form, you save the many orders information in the sub form, and you save only the company ID. So the orders table has:
tblOrders
OrdersID, CompanyID, OrderDate, DeliveryDate, etc.

The trick you are looking for, is that you put the CompanyID text box in the sub form and hide it, but it gets saved with every order. How? In the on current event of the sub form, you put a little code that takes the value of the CompanyCombo, the CompanyID and put it into the subform text box called CompanyID and that causes it to be saved with each record.

If you take my suggestion, let me know and I can help you with the rest of the code
Privateer
 
Thanks for your suggestion I will definitely try it once I have redesigned the database to my bosses mew specifications. Thanks for the help.
 

Users who are viewing this thread

Back
Top Bottom