paulig2001
Registered User.
- Local time
- Today, 11:39
- Joined
- Apr 12, 2005
- Messages
- 13
When I open my report from the main form using the code:
my ID card report opens fine. But I want the user to be able to click a button on the main form, opening another window that allows them to select from the various reports available using option buttons, I use this code
To me this looks like it should do the same thing, but what seems to happen is that the report momenteraly flashes up on the screen (I'm not sure if it is properly generated cause its only there for a fraction of a second) and disappears again!
Any idea what the hell is going on here????????????????
Private Sub Command55_Click()
strIDRecSource = "SELECT tblEmployee.lngStaffIDPK, tblEmployee.strFirstName, tblEmployee.strSurname, tblEmployee.dtmDateBirth, tblEmployee.lngWorkCatagoryID, tblEmployee.lngContractorID, tblEmployee.strPhotoName, tblEmployee.strSigName, qryNTCPcourses.Expr1, tblEmployee.dtmExpiryDate, qryNTCPcourses.Expr2 FROM tblEmployee INNER JOIN qryNTCPcourses ON tblEmployee.lngStaffIDPK = qryNTCPcourses.lngStaffIDPK;"
DoCmd.OpenReport "rptIDCard", acPreview, , "lngStaffIDPK = " & Me.lngStaffIDPK
End Sub
my ID card report opens fine. But I want the user to be able to click a button on the main form, opening another window that allows them to select from the various reports available using option buttons, I use this code
If Me.optEmp = 1 And Me.optRpt = 1 Then
'opens the report on the current record if that option is checked
strIDRecSource = "SELECT tblEmployee.lngStaffIDPK, tblEmployee.strFirstName, tblEmployee.strSurname, tblEmployee.dtmDateBirth, tblEmployee.lngWorkCatagoryID, tblEmployee.lngContractorID, tblEmployee.strPhotoName, tblEmployee.strSigName, qryNTCPcourses.Expr1, tblEmployee.dtmExpiryDate, qryNTCPcourses.Expr2 FROM tblEmployee INNER JOIN qryNTCPcourses ON tblEmployee.lngStaffIDPK = qryNTCPcourses.lngStaffIDPK;"
DoCmd.OpenReport "rptIDCard", acPreview, , "lngStaffIDPK = " & Form_frmEmployeeInformation.lngStaffIDPK
...
etc.
To me this looks like it should do the same thing, but what seems to happen is that the report momenteraly flashes up on the screen (I'm not sure if it is properly generated cause its only there for a fraction of a second) and disappears again!
Any idea what the hell is going on here????????????????