N
NG Tian via AccessMonster.com
Recently i was making a form in access 2002. How i am going to preview the
report based on one of field, criteria in form with a click of a button. For
etc, In "Job Details" form, a result is display in form, then i click a
button to preview the report based on job number whatever it is being shown
in form. Note, each job number have few records. txtJOBNO is a name of field.
The code:
Private Sub cmdjobdetail_Click()
On Error GoTo Err_cmdjobdetail_Click
Dim stDocName As String
stDocName = "Job Details"
stLinkCriteria = "[JOB NO]= " & Me.txtJOBNO
DoCmd.OpenReport stDocName, acViewPreview, , stLinkCriteria
Exit_cmdjobdetail_Click:
Exit Sub
Err_cmdjobdetail_Click:
MsgBox Err.Description
But my code does not work. T_T ....
report based on one of field, criteria in form with a click of a button. For
etc, In "Job Details" form, a result is display in form, then i click a
button to preview the report based on job number whatever it is being shown
in form. Note, each job number have few records. txtJOBNO is a name of field.
The code:
Private Sub cmdjobdetail_Click()
On Error GoTo Err_cmdjobdetail_Click
Dim stDocName As String
stDocName = "Job Details"
stLinkCriteria = "[JOB NO]= " & Me.txtJOBNO
DoCmd.OpenReport stDocName, acViewPreview, , stLinkCriteria
Exit_cmdjobdetail_Click:
Exit Sub
Err_cmdjobdetail_Click:
MsgBox Err.Description
But my code does not work. T_T ....