Codes

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • coachafrane
    New Member
    • Mar 2014
    • 7

    Codes

    I have a code running that greys out and disable the specified pages of a record when a selection is made from a combo box
    This how the codes look like

    Code:
    Private Sub employmentstatus_AfterUpdate()
    If Me.[employmentstatus] = "RETIRED" Then
       Me.[PersonalDetails].Enabled = False
       Me.[EmployDetails].Enabled = False
       Me.[PayRoll].Enabled = False
       Me.[FamilyDetails].Enabled = False
    Else
       Me.[PersonalDetails].Enabled = True
       Me.[EmployDetails].Enabled = True
       Me.[PayRoll].Enabled = True
       Me.[FamilyDetails].Enabled = True
      End If
    If Me.[employmentstatus] = "VACATED POST" Then
        Me.[PersonalDetails].Enabled = False
        Me.[EmployDetails].Enabled = False
        Me.[PayRoll].Enabled = False
        Me.[FamilyDetails].Enabled = False
    Else
        Me.[PersonalDetails].Enabled = True
        Me.[EmployDetails].Enabled = True
        Me.[PayRoll].Enabled = True
        Me.[FamilyDetails].Enabled = True
    End If
    End Sub
    I have converted to ACCDE format and after the conversion error message pops up.
    Pic 1 shows the error
    Pic 2 shows the combo box where the status is updated
    Pic 3 shows the effect after update

    I would be so grateful for your expert advice and direction.
    Thanks
    [imgnothumb]http://bytes.com/attachment.php? attachmentid=75 48[/imgnothumb]
    [imgnothumb]http://bytes.com/attachment.php? attachmentid=75 49[/imgnothumb]
    [imgnothumb]http://bytes.com/attachment.php? attachmentid=75 50[/imgnothumb]
    Attached Files
    Last edited by zmbd; Mar 26 '14, 01:58 PM. Reason: [Z{Please use the <CODE/> button to format posted script and formated text - Please read the FAQ}{Made attached images visable inline}]
  • jimatqsi
    Moderator Top Contributor
    • Oct 2006
    • 1288

    #2
    Coach,
    Welcome to Bytes. One of the things you'll learn here is that a lot of people cannot or will not download attachments for fear of malware.


    Please tell us what the error message is that you see.

    Jim

    Comment

    • zmbd
      Recognized Expert Moderator Expert
      • Mar 2012
      • 5501

      #3
      coachafrane:
      Welcome and thank you for using the advanced option to upload the images.
      Jim is correct that most of use will not download unrequested attachements; however, as these are images uploaded here at Bytes I can (and have) placed them inline so that we can see them w/o d/l (^_^)

      I need you to do a few things for me:
      1) What version of Office\Access are you using.
      2) Confirm that the form works correctly in the ACCDB version of the file - this includes going into the VBA editor and from the menu - debug - compile
      3) This appears to be a tabbed form; however, If you are using ACC2010 or newer, are you using the new "Navigation Control" instead of the tabbed form?

      Comment

      • coachafrane
        New Member
        • Mar 2014
        • 7

        #4
        Thanks for the direction

        I am using access 2010

        Yea, i works alright in ACCDB
        The error comes up after convert to ACCDE

        Comment

        • zmbd
          Recognized Expert Moderator Expert
          • Mar 2012
          • 5501

          #5
          Please answer the last question (#3).
          thnx

          Comment

          • coachafrane
            New Member
            • Mar 2014
            • 7

            #6
            Answer: the new one

            Thanks zmbd

            Comment

            • zmbd
              Recognized Expert Moderator Expert
              • Mar 2012
              • 5501

              #7
              That's what I figured.
              For ease, I'll refer to this control as "navctrl"

              There is a known bug in that if you use a multitiered/tabbed navctrl that if the property of the form is set to "has module = yes" (show the form properties, this property is shown on the "other" tab) that weird "stuff" happens - and what is happening to you is just one such issue.

              The only known work around is to remove all code from the form, set the property to "no" and then use the Access Macro to call the required VBA code.

              Yes this is a monky-wrench; however, MS doesn't seem too interested in fixing this glitch.

              A few things to keep in mind:
              (1) The navigation control, despite appering as a tab control really is not; therefor, the information contained within any article about tabbed controls does not pertain.

              (2) Directly related to your issue http://bytes.com/topic/access/answer...nt-tab-clicked

              (3)You should read thru this thread as it discusses some things you will find usefull with the navctrl http://bytes.com/topic/access/answer...ms#post3760995

              (4) I know this post goes over some of the same above; however, I think it lists some other information too (^_^)


              Let us know if there is anything else that will help you get thru this.
              Personally, I like the visual "feel" of the navctrl; however, it can be a beast to deal with - so BOL.

              Comment

              Working...