Results 1 to 8 of 8
  1. #1
    4 Star Lounger
    Join Date
    Jan 2002
    Location
    Brookings, South Dakota, USA
    Posts
    449
    Thanks
    0
    Thanked 0 Times in 0 Posts

    can't set visible = true (A2k3 SP2)

    Hi All,
    I've got a bit of a visibility problem.
    In opening a popup form from another popup form I will hide the calling popup after passing it's name to the called popup with OpenArgs.
    <pre>strFormName = "popfrmQualityReport"
    strOpenArgs = Me.Form.Name
    DoCmd.OpenForm strFormName, , , , , , strOpenArgs

    Me.Visible = False
    </pre>


    Then when I am done with the called popup I will make the original calling popup "re-visible"
    <pre>strFormName = Nz(Me.OpenArgs, "")

    If Len(strFormName) > 0 Then
    Forms(strFormName).Visible = True
    Else
    'do nothing
    End If

    DoCmd.Close acForm, Me.Form.Name
    </pre>

    However, it is not becoming visible and it is not closed. When stepping through the code and I highlight Forms(strFormName).Visible it shows Forms(strFormName).Visible = False after I step through it. I've tried different variations of Pop up/Modal/Border style, importing everything into a new db, changed pc's, checked/unchecked <Use Windows Themed Controls on Forms> and still I can't do visibility = True for this database. I have another db, same code used in the same way and it works just fine. My normal setup includes unchecked <Use Windows Themed Controls on Forms>; popup forms with dialog Border Style, Popup, Modal and Auto Center set to yes and Auto Resize set to no.
    So, I sure could use some advice.
    Thank you.
    <IMG SRC=http://www.wopr.com/w3tuserpics/gdrezek_sig.jpg>
    "Those who dance are considered insane by those who can't hear the music" - George Carlin

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

    Re: can't set visible = true (A2k3 SP2)

    If you open a form with Modal set to True, or use WindowMode:=acDialog in the DoCmd.OpenForm line, the calling code will pause until the popup form is closed. So the line Me.Visible = False will be executed *after* the popup form is closed. Try placing the line Me.Visible = False *before* the DoCmd.OpenForm line.

  3. #3
    4 Star Lounger
    Join Date
    Jan 2002
    Location
    Brookings, South Dakota, USA
    Posts
    449
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: can't set visible = true (A2k3 SP2)

    Hi Hans,
    I changed it like so:
    <pre>Me.Visible = False

    strFormName = "frmModuleLineDefects"
    strOpenArgs = Me.Form.Name

    DoCmd.OpenForm strFormName, , , , , , strOpenArgs
    </pre>

    and still no visibility. Same symptoms as before.
    Thanks.
    <IMG SRC=http://www.wopr.com/w3tuserpics/gdrezek_sig.jpg>
    "Those who dance are considered insane by those who can't hear the music" - George Carlin

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

    Re: can't set visible = true (A2k3 SP2)

    Could you post a stripped down copy of your database? See <post#=401925>post 401925</post#> for instructions.

  5. #5
    4 Star Lounger
    Join Date
    Jan 2002
    Location
    Brookings, South Dakota, USA
    Posts
    449
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: can't set visible = true (A2k3 SP2)

    OK
    <IMG SRC=http://www.wopr.com/w3tuserpics/gdrezek_sig.jpg>
    "Those who dance are considered insane by those who can't hear the music" - George Carlin

  6. #6
    4 Star Lounger
    Join Date
    Jan 2002
    Location
    Brookings, South Dakota, USA
    Posts
    449
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: can't set visible = true (A2k3 SP2)

    I forgot to import frmCalendar.....here it is.
    <IMG SRC=http://www.wopr.com/w3tuserpics/gdrezek_sig.jpg>
    "Those who dance are considered insane by those who can't hear the music" - George Carlin

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

    Re: can't set visible = true (A2k3 SP2)

    Apparently you can't manipulate another form while a modal form is open. Try the following:
    - Remove the code to make frmSwitchboard visible from the On Click code of the Close button on frmModuleLineDefects.
    - Use the following code in the On Click event of the 'Open Defect Data Entry' button on frmSwitchboard:

    Me.Visible = False
    DoCmd.OpenForm strFormName, , , , , acDialog, strOpenArgs
    Me.Visible = True

    The acDialog argument ensures that the code pauses until the form is closed.

  8. #8
    4 Star Lounger
    Join Date
    Jan 2002
    Location
    Brookings, South Dakota, USA
    Posts
    449
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: can't set visible = true (A2k3 SP2)

    Got it. This is easier to maintain as well.
    Thank you.
    <IMG SRC=http://www.wopr.com/w3tuserpics/gdrezek_sig.jpg>
    "Those who dance are considered insane by those who can't hear the music" - George Carlin

Posting Permissions

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