passing value

aymanmb

Registered User.
Local time
Today, 19:07
Joined
Jan 28, 2007
Messages
96
Dear Friends,

your help is very much needed.

I have a form linked to Orders table (and has the field OrderID) and a subform linked to "Order Details" table and also has the field OrderID. both tables have one-many relationship via the OrderID.

How to make the subform read automatically the autonumber generated for the OrderID of the order form.

The problem I am facing is that when I complete the order details subform and ask to go to a new record, it displays the message that i can not add a record because there is a required field missing (OrderID).

2nd question is when I ask for a new record in Order form, the subform is still showing the older records of the previous order. is ther a way to make the subform show a clean record page when I go to a new order.

thanks
 
It would appear that you either aren't using the subform correctly or have it setup incorrectly. I'm attaching a sample that you can look at to hopefully see how it should be set.
 

Attachments

thanks for the example.

I do not see yet what I am doing wrong. I drged the subform to the mother form. what setup should I adjust?
 
Look to the Child / Master links within the subform control
 
Can you please look at the attached database and tell me what is wrong.

looks like I can not add records to the subform (message that a reuquired field in order table is missing, and I have no idea what it is).

thanks a lot for your kind help and patience
 

Attachments

Okay, there are several things you have going against you. First, is the tables setup.

1. If you have the supplier ID stored with the product, you don't need it in the order details table.
2. Purchase # should be PurchaseNo (don't use special characters in object names; it will only come back to hurt you).
3. Your subform didn't have OrderID on it so it could be linked correctly to the main form. The links were not set properly.
4. On your subform you had a combo to select supplier, but supplier is already set in the products table so you just need to display the supplier. I changed it so it would do that.
5. Your Orders form was set to Allow Additions = No which makes it so you can't add any orders.

See attached with changes
 

Attachments

many thanks, can not find words to express my gratitude
 
Hi boblarson

could you please help me once more.

Attached database contains a button on orders form to filter uncompleted orders only based on selecting unchecked "completed" field. I did it based on example given by MStef but unfortunbately a missing link to the newly added field "company name" appearede.

I do not know how to writ the code to include it in thr click action of the button.

Can you help me since you helped me with an earlier version of this database.

thanks a lot for your time
 

Attachments

Users who are viewing this thread

Back
Top Bottom