Results 1 to 4 of 4
  1. #1
    Join Date
    Sep 2003
    Location
    Waterford
    Posts
    2

    Unhappy Unanswered: Moving From Switchboard to other screens Problem [Access 97]

    I have a quick question about a bug i cant get out of my database in access 97.
    I have 3 main forms where i have a button to move back and forth to the main switchboard. The Code for moving back and forth to the main screens works for one screen only.

    Private Sub Cmdback1_Click()
    Form_Switchboard.Visible = True
    Form_twusage.Visible = False
    Form_Adddel.Visible = False
    End Sub

    This should and does for the first screen , move from say twusage to the switchboard screen but however when i move to say the other screen adddel the button will not activate.
    This will happen the other way too so i dont think it is a code issue. For it to work i have to build the event (not change any code - just open the code page and close it again) when i open the program so the program knows what it has to do and then it will work sweetly for the time i have the database open until i have to close it. Then i have to reactivate the code again. Any one have any ideas on how to combat this

  2. #2
    Join Date
    Sep 2003
    Location
    Solihull, UK
    Posts
    5
    This seems to work (unless I completely missed the point, in which case I'll just curl up in a corner and keep quiet.)

    I've created 3 forms called switchboard, Form1 and Form2. Each has a Command Button except switchboard which has 2. The code for the form switchbard is as follows:


    Private Sub Form_Open(Cancel As Integer)
    DoCmd.OpenForm "Form1"
    DoCmd.OpenForm "Form2"
    End Sub

    Private Sub Command1_Click()
    Forms!form1.Visible = True
    Forms!form2.Visible = False
    Me.Visible = False
    End Sub

    Private Sub Command2_Click()
    Forms!form2.Visible = True
    Forms!form1.Visible = False
    Me.Visible = False
    End Sub

    The code for Form1 CommandButton is

    Private Sub Command1_Click()
    Forms!switchboard.Visible = True
    Forms!form1.Visible = False
    End Sub

    and the code for Form2 CommandButton is

    Private Sub Command1_Click()
    Forms!switchboard.Visible = True
    Forms!form2.Visible = False
    End Sub



    Hope this helps.

  3. #3
    Join Date
    Sep 2003
    Location
    Waterford
    Posts
    2
    Rob Thanks a Million . I thought i was going to have to re write this using VB6 or C# but you ve seemed to have solved the bug

  4. #4
    Join Date
    Sep 2003
    Location
    Solihull, UK
    Posts
    5
    Glad to have helped.

    Rob.

Posting Permissions

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