×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Help with using subform data in Master-form fields

Help with using subform data in Master-form fields

Help with using subform data in Master-form fields

(OP)
OVERVIEW:
We have a PRODUCTS sub-form included in a CONTRACTS Main form that displays a single matching PRODUCTS record based on [productIdCode].  When a product is selected in [ProductsIdCode] (ComboBox) a corresponding record from the PRODUCTS table is displayed.  Only one product is allowed per contract.  The purpose of the PRODUCTS sub-form is to show (non-editable) product information and “suggested pricing”.  Actual pricing is included in the CONTRACT records and typically varies from the “suggested” information.


OBJECTIVE:
To use (copy) information from the sub-form fields to similar fields in the CONTRACTS main-form as “default” entries using a control button.  The “copied” values must be editable (not linked to the PRODUCTS record).


EXAMPLE:
The PRODUCTS table contains information on generic equipment including “product id code”, “product description”, “suggested price” and “suggested down payment”.  A single product record is displayed in a sub-form based on a field value entered on a “new CONTRACTS” form.   The “new CONTRACTS” form also contains separate (non-linked) fields for “product description”, “suggested price” and “suggested down payment”.  We need to be able to “copy” the information from the PRODUCTS sub-form fields to similar fields in the main form (“new CONTRACTS”) using a “control button” and without affecting the information in the PRODUCTS table.  The USER need to be able to “manually adjust” (override) the “product description”, “suggested price” and “suggested down payment” information in the “new CONTRACTS form on a case by case basis.

RE: Help with using subform data in Master-form fields

I would link the ProductID to the products table. Then in each of the other fields I would set their default value to a DLookUp() function that returns these from the Product table. When the record is saved these values (or whatever they are changed to) will become those saved in the record.

So, for example, for the product description you could use something like the following in the Default value property of the control:

=DLookUp("[Product Description]", "Product Table", "[ProductID] = " & Forms!FormName!ProductID)

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close