Results 1 to 12 of 12
  1. #1
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    Jacksonville,NC, USA
    Posts
    705
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Switchboard woes (Access 2000)

    Hi folks,
    I have a secretary downstairs who I have been helping create a budget database. Against my better discretion she used a switchboard manager to create her switchboard...i for years have just learned to write my code, create my macros, and either drag those macros onto a custom made form, or apply the code I desire to the buttons I create on the form...anyway...since she used the Switchboard anyway...here is the problem she is having. Can anyone give me a clue as to what to suggest to her:

    TO: Nannette
    I am SO regretting using the Switchboard to create my opening forms. I set the password on the "Enter Orders" command button, but it also required the password on the same button on the next switchboard page, which is the view reports page. Is there a way to prevent that? Or would it be best to recreate the form manually?
    From: Secretary downstairs

    Thanks a bunch folks
    Nannette
    NMP <img src=/S/cool.gif border=0 alt=cool width=15 height=15>

    If you can't convince them, confuse them. - Harry Truman <img src=/S/scratch.gif border=0 alt=scratch width=25 height=29>

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

    Re: Switchboard woes (Access 2000)

    Hi Nannette,

    There is nothing intrinsically wrong with the Switchboard Manager or with the form it creates, but apparently the "secretary downstairs" has modified the code behind the Switchboard form, probably the HandleButtonClick function. Could you ask her to send you this code, then post it here?

  3. #3
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    Jacksonville,NC, USA
    Posts
    705
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Switchboard woes (Access 2000)

    you bet...thanks Hans [img]/forums/images/smilies/smile.gif[/img]
    NMP <img src=/S/cool.gif border=0 alt=cool width=15 height=15>

    If you can't convince them, confuse them. - Harry Truman <img src=/S/scratch.gif border=0 alt=scratch width=25 height=29>

  4. #4
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    Jacksonville,NC, USA
    Posts
    705
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Switchboard woes (Access 2000)

    Hans,
    Ok...I see instead of the HandleButtonClick(1) function on the "On Click" event line of her command button, that it has been replaced with "Event Procedure" and here is the code that I told her to put into the Event Procedure...so this is coming back to haunt me (all my fault, but I told her I didn't like using the Switchboard manager, I remember why now).... am attaching the code.
    Thanks for peeking at it.
    Nannette
    Attached Files Attached Files
    NMP <img src=/S/cool.gif border=0 alt=cool width=15 height=15>

    If you can't convince them, confuse them. - Harry Truman <img src=/S/scratch.gif border=0 alt=scratch width=25 height=29>

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

    Re: Switchboard woes (Access 2000)

    There is NOTHING wrong with using the Switchboard Manager to create a switchboard. I've used it repeatedly for years in all versions of Access without any big problems. There is only trouble if you don't understand what the switchboard actually does and try to make it do something else, again without understanding what you're doing. The switchboard created by the wizard is actually a very efficient, and even elegant, table-driven form; but if you don't understand the concept of table-driven forms, then you can get into difficulties with no effort at all.
    Charlotte

  6. #6
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    Jacksonville,NC, USA
    Posts
    705
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Switchboard woes (Access 2000)

    ...see my email please Charlotte...you did it again.
    NMP <img src=/S/cool.gif border=0 alt=cool width=15 height=15>

    If you can't convince them, confuse them. - Harry Truman <img src=/S/scratch.gif border=0 alt=scratch width=25 height=29>

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

    Re: Switchboard woes (Access 2000)

    By putting an event procedure like this in the On Click event of Option2 and/or OptionLabel2, the same code will be executed by clicking on this button regardless of the switchboard page. You should have her put back the default =HandleButtonClick(2) instead of Event Procedure of both Option2 and OptionLabel2.

    Then, have her put some extra code in the HandleButtonClick code - additions to original code in bold:

    ' Open a form.
    Case conCmdOpenFormBrowse
    If rst![Argument] = "frmMasterOrders" Then
    Dim strPasswd As String
    strPasswd = InputBox("Enter Password", "Restricted Form")
    ' Check to see if there is any entry made to input box, or if
    ' Cancel button is pressed. If no entry made then exit sub.
    If strPasswd = "" Then
    MsgBox "No Input Provided", vbInformation, "Required Data"
    Exit Sub
    End If
    ' If incorrect password entered, show message and exit sub
    If strPasswd <> "Christy" Then
    MsgBox "Sorry, you do not have access to this form", vbExclamation, "Important Information"
    Exit Sub
    End If
    End If

    DoCmd.OpenForm rst![Argument]

    This is not very elegant, but it provides an ad hoc addition without disturbing the original action.

  8. #8
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    Jacksonville,NC, USA
    Posts
    705
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Switchboard woes (Access 2000)

    Will tell her to try this, and will let you know how it works...i tried it on a copy she gave me, and it keeps shutting the whole program down...and asks to send microsoft the error message...which i don't...but will work with it, and see what i can do...
    thanks HansV
    Will let you know
    NMP <img src=/S/cool.gif border=0 alt=cool width=15 height=15>

    If you can't convince them, confuse them. - Harry Truman <img src=/S/scratch.gif border=0 alt=scratch width=25 height=29>

  9. #9
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    Jacksonville,NC, USA
    Posts
    705
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Switchboard woes (Access 2000)

    Hans,
    I'm going to zip up this database, and let you look. Don't worry about the logo screen error. The password if needed is 344 to bypass startup while holding shift so you can get into design view. But I have already diabled that, so you should just be able to waltz in while holding shift. The welcome screen comes up, and its the View reports icon...click it...then the supplies report icon...its not working...just shutting down. I am sending it just as she sent it to me...would you take a peek when you have time.
    Thanks so much.
    Nannette
    Attached Files Attached Files
    NMP <img src=/S/cool.gif border=0 alt=cool width=15 height=15>

    If you can't convince them, confuse them. - Harry Truman <img src=/S/scratch.gif border=0 alt=scratch width=25 height=29>

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

    Re: Switchboard woes (Access 2000)

    I don't have problems opening the Supplies Report - see screenshot <img src=/S/scratch.gif border=0 alt=scratch width=25 height=29>
    Attached Images Attached Images
    • File Type: png x.png (15.6 KB, 0 views)

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

    Re: Switchboard woes (Access 2000)

    There are two problems with the code I posted:
    - I used Exit Sub twice; this should be Exit Function since HandleButtonClick is a function, not a procedure.
    - I used rst for the recordset, it should have been rs
    Sorry about that. However, these errors shouldn't lead to Access closing down.

    I have attached the database with the check for a password on frmMasterOrders. Not that it is very secure...

    Notes:
    - The button for enabling/disabling the bypass key has been put on top of one of the existing buttons (Option6) - not very nice, since
    a) it will always be visible, unlike the original buttons
    [img]/forums/images/smilies/cool.gif[/img] It makes Option6 inaccessible
    - The password for enabling/disabling the bypass key is 334, not 344 ...
    Attached Files Attached Files

  12. #12
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    Jacksonville,NC, USA
    Posts
    705
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Switchboard woes (Access 2000)

    Hans:
    Thank you for taking the look and seeing what was up. I have no problems when I don't hold shift and do the bypass thing. Everything works just fine. My problem, (and I'm assuming it's my computer) seems to happen when I hold shift and bypass the startup, then open the switchboard and try the supply report button. Crazy. It will hold water, and am going to send it back to her, with salutes to you in the email...I know she will appreciate all your help, as I most certainly "always" do. Bless you my favorite "guru". Your always teaching me so many new things.
    As always I Salute you sir <img src=/S/salute.gif border=0 alt=salute width=15 height=20>
    Nannette
    NMP <img src=/S/cool.gif border=0 alt=cool width=15 height=15>

    If you can't convince them, confuse them. - Harry Truman <img src=/S/scratch.gif border=0 alt=scratch width=25 height=29>

Posting Permissions

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