Page 1 of 2 12 LastLast
Results 1 to 15 of 29
  1. #1
    4 Star Lounger
    Join Date
    Apr 2001
    Location
    Guatemala City
    Posts
    515
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Controls on tab forms (Win XP Access 2003)

    I have a form with two tabs

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Controls on tab forms (Win XP Access 2003)

    You have to refer to subform #1 through the main form. Either

    =[Parent]![subfrm1]![Text44]

    or

    =[Forms]![frmMain]![subfrm1]![Text44]

    where frmMain is the name of the main form. Also note that you must use the name of subform #1 as a control on the main form. This is not necessarily the same as the name it has in the database window.

    See Forms: Refer to Form and Subform properties and controls on the Access Web for an overview.

  3. #3
    4 Star Lounger
    Join Date
    Apr 2001
    Location
    Guatemala City
    Posts
    515
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Controls on tab forms (Win XP Access 2003)

    OOPS!

  4. #4
    5 Star Lounger
    Join Date
    Nov 2004
    Location
    Wilmington, North Carolina, USA
    Posts
    1,196
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Controls on tab forms (Win XP Access 2003)

    Which control are you trying to carry across? try something like

    =forms![parentform]![childform].form![controlname]
    ____________________________
    Jeremy
    "If you spend more on coffee than on IT security, then you will be hacked. What's more, you deserve to be hacked." -Richard Clarke

  5. #5
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Controls on tab forms (Win XP Access 2003)

    Use this as control source for a text box on the second subform

    =Parent!DatesForQuincena!Text44

    and force a recalculate of the second subform when Text44 on the first subform is updated:

    Private Sub Text44_AfterUpdate()
    Me.Parent!DataForQuincena.Form.Recalc
    End Sub

  6. #6
    4 Star Lounger
    Join Date
    Apr 2001
    Location
    Guatemala City
    Posts
    515
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Controls on tab forms (Win XP Access 2003)

    I used this form, =forms![parentform]![childform].form![controlname],
    as suggested by NYIntensity, and the Recalc as you suggested. It works!

    One small problem. I have to press Tab or Enter twice to move out of the data field in the DatesForQuincena subform. I commented out the Recalc instruction, but it still needs the double Tab. Any ideas of why that is happening?

  7. #7
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Controls on tab forms (Win XP Access 2003)

    If you comment out the Recalc instruction, you shouldn't need to press Tab twice. I tested it in the database you attached. Did you change something else too?

  8. #8
    4 Star Lounger
    Join Date
    Apr 2001
    Location
    Guatemala City
    Posts
    515
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Controls on tab forms (Win XP Access 2003)

    You are right. Without the Recalc, I don't need the double tab; however, the numbers don't move across to the second subform. The Recalc is necessary. If there is no alternative, I can live with this.

  9. #9
    5 Star Lounger
    Join Date
    Nov 2004
    Location
    Wilmington, North Carolina, USA
    Posts
    1,196
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Controls on tab forms (Win XP Access 2003)

    You could use a little "dirty" code - on key press of either tab or enter on that field, set focus on the next one.... <img src=/S/grin.gif border=0 alt=grin width=15 height=15>
    ____________________________
    Jeremy
    "If you spend more on coffee than on IT security, then you will be hacked. What&#39;s more, you deserve to be hacked." -Richard Clarke

  10. #10
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Controls on tab forms (Win XP Access 2003)

    You could use a pulic property of the parent form as well. Set the value of that property in the appropriate event of the first subform to the total you want to carry forward. In the enter or activate or gotfocus event of the second subform, just update a texbox on that subform to the value in the parent form's custom property. Alternatively, have the second subform read the value from the control in the first subform
    Charlotte

  11. #11
    4 Star Lounger
    Join Date
    Apr 2001
    Location
    Guatemala City
    Posts
    515
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Controls on tab forms (Win XP Access 2003)

    I'm not bashful. That worked just fine.

  12. #12
    4 Star Lounger
    Join Date
    Apr 2001
    Location
    Guatemala City
    Posts
    515
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Controls on tab forms (Win XP Access 2003)

    Now I am trying to link the main form, EmpleadosTab, to the two sub forms, DataForQuincena and DatesForQuincena. I created an unbound combo box on the main form to select IDEmp. The AfterUpdate event runs:

    Dim rs As Object
    Set rs = Me.Recordset.Clone
    rs.FindFirst "[IDEmp] = " & Me![IDEmp] & ""
    If Not rs.EOF Then Me.Bookmark = rs.Bookmark

    That finds the IDEmp and moves the record in the main form.

    Then I try to synchronize the sub forms with an OnCurrent event in the sub form like:

    Forms!EmpleadosTab!DataforQuincena.Filter = "IDEmp = " & IDEmp. I tried .Form before .Filter also.

    That does not work. Thoughts?

  13. #13
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Sint Niklaas, Belgium
    Posts
    2,778
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Controls on tab forms (Win XP Access 2003)

    If the main form and the subform are linked by master field and child field, you don't have to filter the subforms.
    What are you trying to do ?
    Francois

  14. #14
    5 Star Lounger
    Join Date
    Nov 2004
    Location
    Wilmington, North Carolina, USA
    Posts
    1,196
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Controls on tab forms (Win XP Access 2003)

    What is the record source of a the subform? If it's a query, then in your query, under the criteria, use the statement

    =iif(isnull([forms]![mainform]![combobox]),[IDEmp],[forms]![mainform]![combobox])

    And use Me.SubformName.Requery in the after update event of that combo box.

    I agree with Francois on this. If it wasn't linked when you first set up the form (through the wizard), perhaps you could delete the subform and reinsert it, using the wizard to establish the link.
    ____________________________
    Jeremy
    "If you spend more on coffee than on IT security, then you will be hacked. What&#39;s more, you deserve to be hacked." -Richard Clarke

  15. #15
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Controls on tab forms (Win XP Access 2003)

    You don't need to delete and reinsert a subform to link it to the main form. If you click the builder button (the ... on the right hand side) in the Link Master Fields or Link Child Fields property (it doesn't matter which of the two), Access will suggest the most probable link fields; you can edit this suggestion as needed.

Page 1 of 2 12 LastLast

Posting Permissions

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