A
Alex H
Hi
I have a mainform with a subform. On occassions I need to print a report
based on the current record. I have a field called [RecordId ](which is an
autonumber and is visible on the main form. The control Name is CID.
I am using the following code
Dim strDocName As String
Dim strCriteria As String
Dim Id As String
strDocName = "RptEnableLicenceNotification"
strCriteria = "[RecordId] = '" & Me![CID] & "'"
Id = [RecordId]
MsgBox Id
DoCmd.OpenReport strDocName, acViewPreview, , strCriteria
I am using the message box to ensure that I am getting the right record,
which I am, but then literally nothing happens.
If I remove the strCriteria line, the report is displayed with the correct
data, the only problem is that it displays all of the records in the table,
not just the first one, and if I forget to select to print just record
number 1 from printer options, i use another tree!!
Any help much appreciated
XXXX
I have a mainform with a subform. On occassions I need to print a report
based on the current record. I have a field called [RecordId ](which is an
autonumber and is visible on the main form. The control Name is CID.
I am using the following code
Dim strDocName As String
Dim strCriteria As String
Dim Id As String
strDocName = "RptEnableLicenceNotification"
strCriteria = "[RecordId] = '" & Me![CID] & "'"
Id = [RecordId]
MsgBox Id
DoCmd.OpenReport strDocName, acViewPreview, , strCriteria
I am using the message box to ensure that I am getting the right record,
which I am, but then literally nothing happens.
If I remove the strCriteria line, the report is displayed with the correct
data, the only problem is that it displays all of the records in the table,
not just the first one, and if I forget to select to print just record
number 1 from printer options, i use another tree!!
Any help much appreciated
XXXX