Results 1 to 5 of 5
  1. #1
    Join Date
    Jun 2012
    Posts
    3

    Unanswered: Access With Multiple SubForms

    I have database which as a mainform and that then has multiple subforms all identical except i need to change the record no of each so each subform then shows slightly different information to the user.

    Main Form ProjectRef = "Smith"
    SubForm1 filter on ProjectRef and should be on Record 1
    SubForm2 filter on ProjectRef and should be on Record 2
    SubForm3 filter on ProjectRef and should be on Record 3
    SubForm4 filter on ProjectRef and should be on Record 4
    SubForm5 filter on ProjectRef and should be on Record 5
    SubForm6 filter on ProjectRef and should be on Record 6
    etc

    If there are no records for "Smith" then Create one
    If there is one record then subform1 shows suform 2 is replaced by a button to create new record if required
    Subform 3 same as 2
    456etc all as 2

    I have subforms filtered apart from moving to the relevant record
    Ihave tried openargs bookmark what would be the best way of doing this and if possible a starter as i quite new to VBA

    Thanks
    Graham

  2. #2
    Join Date
    Aug 2004
    Location
    Cary, NC
    Posts
    264
    Why do you want to do this?

    Multiple records attached to a main records isn't a special situation and can easily be handled with standard navigation.

    A single subform linked to the parent will already show all the appropriate records and when no more records exists a blank form will be there to add.

    Steve

  3. #3
    Join Date
    Jun 2012
    Posts
    3
    Hi Steve thanks for the quick response

    The sub forms are details of windows (Glazing) and include a drawing which is displayed in the subform so the idea is to display the subform with drawing for each item within the main page to give users a visual confirmation that they have accounted for all the items required and all the window units required additionally if the user clicks on an individual subform (picture) they open an another Form (the SubForm is a cut down version of this) which takes them to the appropriate record to modify it and then returns them to the Main Form.

  4. #4
    Join Date
    Aug 2004
    Location
    Cary, NC
    Posts
    264
    I'm still not convinced that what you are asking is the right path for your needs, it just seems like you are over complicated the situation. It would be easier to manage as a single form with a single subform that the user can navigate through to see all the records. But...

    If you really want to dynamically create and manage 7 forms the easiest way is probably to open a recordset in your code for items that match your projectref, then loop through all the records opening and populating the required subforms as you go alone. When you get to the last record open the "add new" form instead.

    Unfortunately, since you are quite new to VBA, this probably isn't the solution you want to deal with. I would change the design at this point so this solution is all I can come up with! Maybe someone else can think of a simpler way to manage 7 forms.

    Steve

  5. #5
    Join Date
    Jun 2012
    Posts
    3
    Hi Steve

    I totally agree that one form would be easier than managing 7 sub forms, 7 is probably the bottom end if it works there could be alot more which I think is going to be extremly difficult to manage and keep a reasonable speed, I think best Option is possibly the you one suggested single form with a single subform to navigate through.

    Unless anybody has a better idea

    Thanks Again
    Graham

Posting Permissions

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