Results 1 to 13 of 13
  1. #1
    BruceAu is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Jul 2012
    Posts
    7

    Access forms - functionality being disabled

    Hi everyone

    I have a custom-built Microsoft Access program with multiple forms that accesses an SQl back end. I am currently experiencing an issue where one of the user's permissions has changed in that some of the functions within the Access forms (i.e. buttons, check boxes) have become disabled. No one has changed any programming code or server permissions that we know of, so we are unsure why this has happened.

    To give you the background:
    - We have a remote access server set up, where users can log in and execute the program, access the database and make changes, based on actions on certain user forms.
    - Upon execution, each user actually has their own .ADE file that runs.
    - We have multiple users using the program and making changes to the SQl back end database
    - The functionality has not changed for other users, only thsi particular user.
    - We have tried resetting the back-end SQL server and kicking out all users, which has not worked either.

    This is my first time on the forum, so please forgive me if I've put this in the wrong spot/area - I am not an experienced Access user and have been handed this going forward so any hints would be great. If you have more questions, let me know, because I may not have given you enough (or the right) information.

    Help


    Bruce

  2. #2
    John_G is offline VIP
    Windows XP Access 2003
    Join Date
    Oct 2011
    Location
    Ottawa, ON (area)
    Posts
    2,615
    If you have a login procedure - can the user experiencing problems use another machine without the problem occurring, and can another user use the problem machine without the problem occurring?

    The object here is to find out if the problem is if machine that user has, or if it has something to do with the user.

    John

  3. #3
    BruceAu is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Jul 2012
    Posts
    7
    Hi John

    The login procedure is via a remote access server, so the Access application runs without log in.

    The application grabs the user ID from the log in. There is a disabling procedure as some users are not allowed access to all features, but non of that has been changed but the permission somehow has.

    The user experiences the same problem on other machines, and I have tried other users on his machine and they have not experienced the same problem.

    I guess that means there is a problem with the user?

    Cheers,
    Bruce

  4. #4
    John_G is offline VIP
    Windows XP Access 2003
    Join Date
    Oct 2011
    Location
    Ottawa, ON (area)
    Posts
    2,615
    Yes - the problem is with the user (in a manner of speaking!).

    What you have to do is look at the code for the forms, and find out what the conditions are that cause the various functions and controls to be disabled; presumably they have something to do with the users' permission levels or access rights.

    Start with the MS Access login procedure if you have one, or with the code that is in the startup form (the first form the users see) - possibly a global variable affecting permissions is not being set correctly. Determine what the specific conditions are that cause the problem for your user are, and find out where and how those conditions are set. Hint - use debug.print (or msgbox) to show you what the values in the critical variables are just before they are checked.

    Clearly there is something about that one user that is different from the others - it might take a number of steps to track it down.

    John

  5. #5
    BruceAu is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Jul 2012
    Posts
    7
    Hi John

    Thanks again for your help.

    The global variable is the user name, and the disabling/enabling procedure runs on the basis of the username. There is no actual procedure that specifically changes that button only (it changes a batch with a simple IF statement).

    We are adamant that it may be a systems administrator issue above our domain, but I can't see anything else that would change that.

    Still confused !

    Oh well, let's try again next week

    Bruce

  6. #6
    John_G is offline VIP
    Windows XP Access 2003
    Join Date
    Oct 2011
    Location
    Ottawa, ON (area)
    Posts
    2,615
    Can you post the code that disables the form controls, specifically the IF ... statement?

    That won't necessarily be the actual problem, but it will help in figuring out where to look next.

    John

    (sort of like playing Clue)

  7. #7
    BruceAu is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Jul 2012
    Posts
    7
    Hi John - see below. I've renamed elements to protect the project IP however, in essence, what is happening is that element 4 (being a button) will be disabled, but other elements remain enabled. There is no other procedure to enable/disable buttons in the whole application.

    This happens only when Mike logs in - when John, Bruce or Kevin log in, everything is fine.

    Cheers
    Bruce

    Sub enable_objects(typer As Boolean, is_final As Boolean)

    If ((common.getUsername = "john" Or common.getUsername = "mike" Or common.getUsername = "bruce" Or common.getUsername = "kevin")) And is_final = False Then
    typer = True


    End If

    Element1.Visible = typer
    Element2.Enabled = typer
    Element3.Enabled = typer
    Element4.Enabled = typer
    Element5.Enabled = typer

    End sub

  8. #8
    John_G is offline VIP
    Windows XP Access 2003
    Join Date
    Oct 2011
    Location
    Ottawa, ON (area)
    Posts
    2,615
    Hi -

    First, there is a potential flaw in the logic. In Sub enable_objects, if Is_Final = true when this is called, then typer will not be changed from its initial value, regardless of who is logged in, because the IF statement will result in False. Is this what you really want?

    Second, when Mike logs in, did you verify that common.getUsername for him really does results in "mike", and not something else? (just use a msgbox to check).

    Third - When and under what conditions is the enable_objects sub being called?

    Last (for now) - having only one of the elements being disabled makes no sense - it has to be all or none. What you could do is try a global search (entire project) for the name "element4", just to verify that its properties are not being changed in a manner you did not expect somewhere in your code.

    I know it's a pain, but I suggest you put in a series of MsgBox messages, to track the code execution.

    HTH

    John

  9. #9
    BruceAu is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Jul 2012
    Posts
    7
    Hi John


    First query - yes that is correct. I've tested this part of the code and it correctly reflects what is going on.

    Second - Mike's name does come up. We had something else funny happen (which I suspect has something to do with our system administrator not telling us that they changed something) in that mike used to log in and record all lower case. Recently, its changed to "Mike" with a capital. No other user has capitalised user names, and it isn't case sensitive. We don't know why this happened, and only to Mike.

    Third - I've checked all the calls. There is one instance of it calling where Is_final = true in the code - see my comment on the last thing.

    Final - the disabling makes no sense, I do agree, should be all or none - the code does work at disabling all the buttons when the call is made. Element4 does not exist in any other piece of code outside of that form.

    Its very strange - the last point is what gets me confused. If there is an issue with the program, or the underlying database behind it, then all the buttons should disable.

    I'm still looking for a solution - the last solution we have is shutting down the 'Mike' user profile and using 'kevin' or 'bruce' instead, both of which still operate normally. Poor Mike

    Thanks John G

  10. #10
    John_G is offline VIP
    Windows XP Access 2003
    Join Date
    Oct 2011
    Location
    Ottawa, ON (area)
    Posts
    2,615
    Hi Bruce -

    As long as you don't shut down Mike along with his profile.....

    On other thing I thought of you might check -

    Do all the buttons on the form have the same initial settings for Enabled in design view? That shouldn't make a difference, but you never know.

    Beyond that, I'm out of ideas.

    Hope you can get Mike operational again.

    Don't you just love it when the network folks make changes, and neglect to tell anyone? We had one a few years ago where the network login script changed the default date format at the Windows level (every time), and people's Excel and Access applications were failing all over the place.

    Let us know how it goes

    John

  11. #11
    BruceAu is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Jul 2012
    Posts
    7
    Hi John G

    You've given me heaps of ideas, and we've tested them all...all the buttons are enabled upon start in the program and design view.

    I think that we need to ask about the network logon script - that has caused an issue

    I've now escalated to our IT/systems guys - let's see what they say

    You've been awesome

    Bruce

  12. #12
    BruceAu is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Jul 2012
    Posts
    7
    Hey John G

    Just an update - guess what? Turns out our systems administrator didn't change the profiles, but forgot to tell us that you can log in as Mike or mike and it makes no difference from that perspective - but it affects the application in access!

    So the solution was to do with the log in even though I was told that there was no case sensitive issues

    Bruce

  13. #13
    John_G is offline VIP
    Windows XP Access 2003
    Join Date
    Oct 2011
    Location
    Ottawa, ON (area)
    Posts
    2,615
    Hi Bruce -

    Do all your code modules have an Option Compare statement at the top? If they do not, the default is Option Compare Binary, which IS case sensitive.

    To make all your text comparisons case insensitive, use Option Compare Text or Option Compare Database at the top of each module.

    Option Explicit is useful as well - using it requires all variables to be explicity declared in Dim statements, and you would be amazed at how many typos that catches, because undeclared variables cause a compilation error.

    John


    John

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 4
    Last Post: 05-17-2012, 01:07 AM
  2. Replies: 2
    Last Post: 03-19-2012, 05:08 AM
  3. Semi-colon Functionality
    By TheDeceived in forum Access
    Replies: 3
    Last Post: 09-22-2010, 10:52 AM
  4. Replies: 0
    Last Post: 06-29-2010, 07:32 AM
  5. Replies: 5
    Last Post: 09-16-2009, 01:56 AM

Tags for this Thread

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