Results 1 to 2 of 2
  1. #1
    craigugoretz is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Feb 2015
    Posts
    9

    How to design a subform using Access 2007's "plumbing"; mutlivalued combo boxes as an alternative

    Hello,

    Say for example I have the following table labeled Master:

    ID: autornumber


    Label: string

    2nd, I have the following table labeled Slave:

    ID: autonumber
    Label: string
    Xref: foreign key to Master.ID field

    In other words, there is a one to many relationship between Master and Slave. In both tables, all fields are required.

    3rd, I have a Master form with a Slave subform:

    Master form:
    ID: xxxxxxxxxxx
    Label: xxxxxxxxxxxxxxxx

    Slave subform:
    ID: xxxxxxxxxxxx
    Label: xxxxxxxxxxxxxxx
    Xref: *** combo box ***

    Finally, I need the Master form and Slave subform to have these properties:

    (1) For every record in the master form, a corresponding record must exist in the subform, based on the Xref foreign key.
    (2) I want to force the user to have to enter a Slave record at the same time they enter a Master record.
    This is before the Master record is saved and data entry moves on to a new record.
    (3) Also, I don't want the user to be able to go back to the Slave subform and delete all records.
    In other words, there is always at least one record in the Slave subform for a corresponding Master form record based on the Xref foreign key.
    (4) However, I want a delete button in the Master form that will delete all corresponding records in the Slave subform at the same time the Master record is deleted.

    I am adverse to doing a lot of programming to accomplish the above because I don't know how this will affect other areas of my database based on Access 2007's "plumbing".
    How instead can I use the "plumbing" to make implementing the above properties sound and robust?

    Thanks kindly,
    Craig

    P.S. My client is adverse to me using a multivalued combo box because they don't want to "have to scan through 500 entries to get the one I want". A multivalued combo box would use a lot more of the plumbing of course. Is there a way, same as the single valued combo boxes, to enter text and have the combo box jump close to that entry in the drop down area? Would a scroll bar make the multivalued combo box practical? I think it would, quite personally, but I would care to hear other views on the subject.

    P.S.S. Is it possible to use the List Items Edit Form property with a multivalued combo box?

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,630
    Items 1 through 3 will require code to perform this validation.

    Item 4 can take advantage of the 'plumbing' by setting a relationship between the two tables and activating referential integrity and cascade delete. However, this means that for item 2, the master record must be saved before related slave records can be created.

    AFAIK, a multi-select combobox cannot utilize Auto Expand like a single-select box. I NEVER use multi-value fields. Most experienced developers consider them a bad design.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. Replies: 13
    Last Post: 03-17-2015, 01:06 PM
  2. Replies: 1
    Last Post: 09-03-2014, 03:27 AM
  3. Access 2007 query export to Excel "feature"
    By sensetech in forum Import/Export Data
    Replies: 6
    Last Post: 11-03-2012, 04:24 AM
  4. Replies: 2
    Last Post: 03-29-2012, 08:49 AM
  5. Replies: 2
    Last Post: 11-04-2011, 02:45 AM

Tags for this Thread

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