Results 1 to 2 of 2
  1. #1
    nkenney is offline Advanced Beginner
    Windows 2K Access 2007
    Join Date
    Mar 2009
    Posts
    40

    Unhappy Subform Help

    I am attempting to create the following form:


    • Invoice Number: (Required, Auto Number, Invoice table and enterable)
    • Date: (Required, Invoice table and Enterable)
    • Customer (Unbound and Display only – Passed from Prior form)
    • Address (Unbound Display Only – Passed from Prior form)
    Sub Form (where the problems are):
    • ID - Invoice Item Table, Auto Number and want to hide it
    • Invoice Number - Invoice Item Table, Copied from above and want to hide it
    • Item Code - Invoice Item Table, will get from next field and want to hide it
    • Item Code Combo Box to select Item Code. Here is the select statement:

    SELECT [Item Code].ID, [Item Code].[Item Code], [Item Code].Description
    FROM [Item Code]
    ORDER BY [Item Code].[Item Code];
    • Description - Unbound, Display Only and Code is put in via the On-Change event on the combo.

    Description = DLookup("[Description ]", "Item Code", "[ID] = " & Me!ItemCode)
    Here is a picture of my subform with 1 row entered:

    ID Invoice Number Item Code Item Code Combo Description
    3 50 9 3157 Light Bulb
    New 50 Light Blub

    My problems:
    1. ID, Invoice and Item code will not be hidden. I have changed the visible, locked and enabled priorities to be No. They are still Display only.
    2. When I add a new Item Code (via the combo) you can see the second line entered.
    3. I would like to have the Item Code combo copy the value over to the Item code Field. The number is the ID from the Item Code Table.
    If you got this far I applaud you. Any and all help on this is appreciated.
    Thanks!

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,640
    1) It sounds like you have the subform in datasheet view? I personally prefer continuous forms, as it gives you a lot more control over the look of the form. If you want to keep the datasheet look, I think you have to set the ColumnHidden property of the desired column.

    2) If you're saying that selecting an option changes all lines to the same thing, this would be normal behavior for an unbound control. It should probably be bound.

    3) Not clear on what you're saying here.

    As a general rule, rather than your code, what I would have for the display only textboxes is a control source like:

    =ComboName.Column(x)

    where x is the appropriate column (zero based). That let's it pick up the value from the combo, and it will change automatically when you make a selection.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 1
    Last Post: 12-10-2005, 04:52 PM
  2. Subform in a Subform and relationships
    By St3ph3n in forum Database Design
    Replies: 3
    Last Post: 12-06-2005, 06:34 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums