Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2010

    Unanswered: command button to populate a subform

    Hi, im creating a rental form for a company and i have a problem which i have spent like 2 weeks trying to figure it out.

    I have a drop down box which selects a product to rent, after that i have 3 option buttons to choose how long the cutomer wants to rent the product for which then links to the product prices in the product table.

    Now the problem, i want to create a button that will then load up a subform with:
    the selected product
    the return date
    and how much it is going to cost.

    How do i create this?

    Thank you

  2. #2
    Join Date
    Jan 2009
    Kerala, India

    command button to populate a subform

    I think you can solve this problem with a Main-Form Sub-Form approach, rather than struggling with the Command Button.

    1. Let the Drop-down control have the Product selected.
    2. Instead of the Option Group control (that will have only value 1,2,3), use another control like a Text Box that can hold the rental period value that can match in the Product Table.
    3. Design a Sub-Form (preferably in datasheet view) and insert below the controls specified in step-1 & 2 above.
    4. Display the Property Sheet of the Sub-Form.
    5. Enter the Main Form Control Names (Product;Period) in the Link Master Field Property.
    6. Enter its corresponding Field Names in the Source Table of Sub-Form in the Link Child Field Property.
    7. Save the Forms.

    When you select a Product and period on the Main-Form its corresponding information from the Product Table will display in the Sub-Form automatically. (Learn MS-Access Tips & Tricks)
    Learn Advanced MS-Access Programming with sample VBA Code.

    All responses are based on Access 2003/2007

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts