Page 2 of 2 FirstFirst 12
Results 16 to 21 of 21
  1. #16
    d9pierce1 is offline Expert
    Windows 10 Access 2016
    Join Date
    Jan 2012
    Location
    Oklahoma
    Posts
    754
    Hi June7,
    Thank you! I do need to get rid of the NotOnList event for the PersonFrm as it does nothing. I added an add button instead, Sorry about that. I just forgot to remove it.



    As far as the
    Put PersonFrm Current event code into a sub behind PersonFrm (don't use Private qualifier) then it can be called by PersonFrm current event:
    you wrote above,
    I am not real clear on that? I take my entire code from the Form_Current and put in a Sub (What would I call this sub) and then just put Settings in the Form_Current? I am sorry but i am not real clear on this.

  2. #17
    d9pierce1 is offline Expert
    Windows 10 Access 2016
    Join Date
    Jan 2012
    Location
    Oklahoma
    Posts
    754
    What i am hearing is this:

    On PersonFrm:

    Code:
    Private Sub Form_Current() Settings End Sub
    Code:
    Sub Settings()
        On Error GoTo Form_Current_Error
        Call subCommon_Form_Current(Me.Form)
        
        Me.CboAddressType.Requery
        Me.CboPhoneType.Requery
        Me.CboEmailType.Requery
        Me.LstRelationship.Requery
        Me.RecordLock = True
        Call RecordLock_Click
        Call ButtonControlOne
        Me.Form.Caption = "Personal Contact"
        
        CboAddressType = DLookup("AddressID", "Person2AddressQry", "PersonID=" & [PersonID] & " AND Preferred=True")
        If IsNull(CboAddressType) Then
        CboAddressType.Enabled = False
        LblAddressTypeEdit.Visible = False
        CmdAddAddress.Visible = True
        Else
        CboAddressType.Enabled = True
        LblAddressTypeEdit.Visible = True
        CmdAddAddress.Visible = False
        End If
        
        CboPhoneType = DLookup("PhoneID", "Person2PhoneQry", "PersonID=" & [PersonID] & " AND Preferred=True")
        If IsNull(CboPhoneType) Then
        CboPhoneType.Enabled = False
        LblPhoneTypeEdit.Visible = False
        CmdAddPhone.Visible = True
        Else
        CboPhoneType.Enabled = True
        LblPhoneTypeEdit.Visible = True
        CmdAddPhone.Visible = False
        End If
        
        CboEmailType = DLookup("EmailID", "Person2EmailQry", "PersonID=" & [PersonID] & " AND Preferred=True")
        If IsNull(CboEmailType) Then
        CboEmailType.Enabled = False
        LblEmailTypeEdit.Visible = False
        CmdAddEmail.Visible = True
        Else
        CboEmailType.Enabled = True
        LblEmailTypeEdit.Visible = True
        CmdAddEmail.Visible = False
        End If
        
    Form_Current_EXIT:
        Exit Sub
    Form_Current_Error:
        Select Case Err
            Case Else
               'Call fcnLogError(Err.Number, Err.Description, " in Form_Current of VBA Document Form_frmAttendees", , True)
        End Select
        Resume Form_Current_EXIT
    End Sub
    And then put on AddressFrm:
    Code:
    Private Sub Form_Close() Forms!PersonFrm.Settings End Sub

  3. #18
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,822
    Yep, that's what I did.
    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.

  4. #19
    d9pierce1 is offline Expert
    Windows 10 Access 2016
    Join Date
    Jan 2012
    Location
    Oklahoma
    Posts
    754
    Well thanks June7, I will work on this this evening! Fantastic...

  5. #20
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,822
    Just figured out how to call event procedure directly. Again, remove Private qualifier then:

    Forms!PersonFrm.Form_Current

    If there is code in Current that should not run when called by AddressFrm, use first approach and just move pertinent code into general Sub. Probably better practice anyway.
    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.

  6. #21
    d9pierce1 is offline Expert
    Windows 10 Access 2016
    Join Date
    Jan 2012
    Location
    Oklahoma
    Posts
    754
    June7,
    Thank you so much as that worked like a charm! Amazing to say the least. I would have never figured that out myself. Again, thank you so much....
    Genius, Genius, Genius...

Page 2 of 2 FirstFirst 12
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Requery Combo Box from second form
    By blueman in forum Forms
    Replies: 14
    Last Post: 11-16-2015, 12:03 PM
  2. Requery a subform form a combo box in a main form!
    By lewisoh in forum Database Design
    Replies: 2
    Last Post: 09-10-2015, 07:23 AM
  3. Replies: 7
    Last Post: 07-01-2015, 10:29 AM
  4. Requery split form data button
    By Evans2 in forum Forms
    Replies: 3
    Last Post: 09-08-2014, 08:59 PM
  5. Replies: 6
    Last Post: 01-13-2010, 02:41 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