Results 1 to 3 of 3
  1. #1
    New Lounger
    Join Date
    Jul 2002
    Location
    Lakeland, FL, USA
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    tab control w/2 subforms (Access 97)

    Hello,

    i'm trying to develop an application that uses the tab control w/2 subforms [one to many-to-many relationship]. i have learned that command buttons are form-specific. this causes a problem when i try to add data to an already existing id number. the data is stored in the underlying tables but is not visible on subform2 nor is the data in subform1 synchronized w/the data in subform2.

    it appears that i am missing a major step that i do not know how to implement/code. i have not had to use any vba coding in this process. however, it appears that i need to concentrate on adding both update and edit functionality.

    b/c i am not familiar w/vba, i do not know how to do this. is there anyone out there that can steer me in the right direction.

    in advance, thanks for your help.
    dezBar

  2. #2
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts

    Re: tab control w/2 subforms (Access 97)

    If you close the forms, then reopen them does all the correct data show up? If so, then the forms are probably linked correctly.

    If this is the case, then you need the subform2 to be requeried when you change data in subform1.

    In the afterupdate event of subform1 you need some code like this:

    forms!mymainform!subform2..requery

    Replace mymainform with the name of your main tabbed form
    Replace subform2 with the name of the second subform as it appears in the main form.

    To find the afterupdate event, open the main form in design view, double click on subform1, then right click and choose properties. One category of properties is Event. click next to "After Update", then on the three dots that appear, and choose "Event procedure"
    Regards
    John



  3. #3
    New Lounger
    Join Date
    Jul 2002
    Location
    Lakeland, FL, USA
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: tab control w/2 subforms (Access 97)

    thank you, it worked w/some tweeking -- i placed the requery command on the 'onGotFocus' of subform2 b/c i got an error message when i placed in on the update control.

    Yes, all data is visible in the proper fields when i close and reopen. something funny is happening now -- as before data is stored in the underlying table for subform2, it's visible when in form view [this was not happening before]. now, when i try to add a second record to the same id number, everything works for subform1 [it actually stores and displays the number of records added]. however, subform2 does not display data for the second record that goes along w/the data in subform1 although it was saved in the underlying table.

    can anyone tell me what is going on and how i can fix it? in advance, thank you so much!
    dezBar

Posting Permissions

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