Hello everyone,
I have a question with my application.
I've created a query form (continuos form) with a click button to open an specific report. I used the next code:
Code:
Private Sub OpenPcmd_Click()
On Error GoTo Err_cmdReport_Click
Dim stDocName As String
Dim stLinkCriteria As String
Dim NC_Record_ID As String
stDocName = "Sys_NCTotal_Rpt"
stLinkCriteria = "[sCode]=" & "'" & Me.Code & "'"
NC_Record_ID = Me.Code
DoCmd.OpenReport stDocName, acViewReport, , stLinkCriteria
MsgBox "Report NC: " & NC_Record_ID, vbInformation, "Sys Management Tool"
Exit_cmdReport_Click:
Exit Sub
Err_cmdReport_Click:
MsgBox Err.Description
Resume Exit_cmdReport_Click
End Sub
it works normal in general an open the report needed, but I have a second code to hidde all the access screens and when I use this the report is not shown
Code:
Option Compare DatabaseOption Explicit
Global Const SW_HIDE = 0
Global Const SW_SHOWMINIMIZED = 2
Global Const SW_SHOWMAXIMIZED = 3
Private Declare PtrSafe Function apiShowWindow Lib "user32" _
Alias "ShowWindow" (ByVal hwnd As Long, _
ByVal nCmdShow As Long) As Long
Function fSetAccessWindow(nCmdShow As Long)
Dim loX As Long
Dim loForm As Form
loX = apiShowWindow(hWndAccessApp, nCmdShow)
End Function
Note: My report setting has the Property Modal: Yes and Emerge: Yes
I don't know why when the function fsetaccesswindows is call this report is not shown, it looks like it would be opened but I don't see it, in fact any report is not shown and I don't know why
Please your help will be highly appreciated