Worked in Windows 2000 but not XP Options

Indigo

Registered User.
Local time
Today, 09:51
Joined
Nov 12, 2008
Messages
241
My workstation where I work was recently updated from Windows 2000 to
Windows XP.
I am running Access 2003 and have the following code running


Code:
Private Sub cmdViewRegisForm_Click() 
On Error GoTo Err_cmdViewRegisForm_Click 

    Dim stDocName As String 
    Dim strWhere As String 

    stDocName = "rptKCRegis" 
    strWhere = "[KCID] = " & Me.IDNumber 

    DoCmd.OpenReport stDocName, acPreview, , strWhere 
    Me.Visible = False 
    Forms!frmSearchKC.Visible = False 

Exit_cmdViewRegisForm_Click: 
    Exit Sub 
Err_cmdViewRegisForm_Click: 
    MsgBox Err.Description 
    Resume Exit_cmdViewRegisForm_Click 
End Sub
It worked fine on Windows 2000, but now that I am running
XP, the:

Code:
    Me.Visible = False 
    Forms!frmSearchKC.Visible = False
Do not work. The forms are still visible. Any suggestions
as to how I overcome this? Thank you.
 
Does it throw an error when it tries to hide the forms, the Me form especially?
 
No, no error pop-up appears. The forms just remain visible over-top of the report.
 
Include a msgbox here:
Code:
    DoCmd.OpenReport stDocName, acPreview, , strWhere 
[COLOR=Blue]    Msgbox "About to make forms invisible"[/COLOR]
    Me.Visible = False
and see if after clicking the box it works.

If it doesn't, then try this:
Code:
    DoCmd.OpenReport stDocName, acPreview, , strWhere
    DoCmd.SelectObject acReport, stDocName
    Me.Visible = False
 
I will give it a try when I return to work in the morning, thank you.
 
By the way, that was just an addition to your original code, so you should still add the other lines too.
 
This worked:

Code:
Msgbox "About to make forms invisible"

But, this:

Code:
DoCmd.SelectObject acReport, stDocName

did not.

Is there anyway around this without the Msgbox?
 
Try moving both Visible code lines to the Load event of the report.
 

Users who are viewing this thread

Back
Top Bottom