By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,935 Members | 1,388 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,935 IT Pros & Developers. It's quick & easy.


P: 7
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

Expand|Select|Wrap|Line Numbers
  1. Private Sub employmentstatus_AfterUpdate()
  2. If Me.[employmentstatus] = "RETIRED" Then
  3.    Me.[PersonalDetails].Enabled = False
  4.    Me.[EmployDetails].Enabled = False
  5.    Me.[PayRoll].Enabled = False
  6.    Me.[FamilyDetails].Enabled = False
  7. Else
  8.    Me.[PersonalDetails].Enabled = True
  9.    Me.[EmployDetails].Enabled = True
  10.    Me.[PayRoll].Enabled = True
  11.    Me.[FamilyDetails].Enabled = True
  12.   End If
  13. If Me.[employmentstatus] = "VACATED POST" Then
  14.     Me.[PersonalDetails].Enabled = False
  15.     Me.[EmployDetails].Enabled = False
  16.     Me.[PayRoll].Enabled = False
  17.     Me.[FamilyDetails].Enabled = False
  18. Else
  19.     Me.[PersonalDetails].Enabled = True
  20.     Me.[EmployDetails].Enabled = True
  21.     Me.[PayRoll].Enabled = True
  22.     Me.[FamilyDetails].Enabled = True
  23. End If
  24. 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.

Attached Images
File Type: jpg Pic 1.jpg (49.5 KB, 189 views)
File Type: jpg Pic 2.jpg (49.6 KB, 165 views)
File Type: jpg Pic 3.jpg (27.8 KB, 166 views)
Mar 26 '14 #1
Share this Question
Share on Google+
6 Replies

Expert 100+
P: 1,240
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.

Mar 26 '14 #2

Expert Mod 5K+
P: 5,397
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?
Mar 26 '14 #3

P: 7
Thanks for the direction

I am using access 2010

Yea, i works alright in ACCDB
The error comes up after convert to ACCDE
Mar 26 '14 #4

Expert Mod 5K+
P: 5,397
Please answer the last question (#3).
Mar 26 '14 #5

P: 7
Answer: the new one

Thanks zmbd
Mar 26 '14 #6

Expert Mod 5K+
P: 5,397
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

(3)You should read thru this thread as it discusses some things you will find usefull with the navctrl

(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.
Mar 26 '14 #7

Post your reply

Sign in to post your reply or Sign up for a free account.