G
GailK
Good afternoon,
-Access 2000
-taken form and put into report in order to print the record being viewed
-print command on form : found and used the following two codes but neither
one allows me to print just the one record.. getting all records. Have
searched all threads to determine cause but unable to locate why/a fix.
-primary key [Record] is a number type field
Thank you!
Code 1:
Private Sub cmdPrint_Click()
On Error GoTo Err_Handler
Dim stDocName As String
Dim stWhere As String
stDocName = "FormViewReport"
stWhere = "[Record] =" & Me![Record]
DoCmd.OpenReport stDocName, acViewNormal, , stWhere
Err_Exit:
Exit Sub
Err_Handler:
MsgBox Err.Description
Resume Err_Exit
Code 2:
Private Sub cmdPrint_Click()
Dim stWhere As String
If Me.Dirty Then
Me.Dirty=False
End If
If Me.NewRecord Then
MsgBox "Select a record to print"
Else
strWhere = "[Record] = " & Me.[Record]
DoCmd.OpenReport "FormViewReport", acViewNormal, , strWhere
End If
End Sub
-Access 2000
-taken form and put into report in order to print the record being viewed
-print command on form : found and used the following two codes but neither
one allows me to print just the one record.. getting all records. Have
searched all threads to determine cause but unable to locate why/a fix.
-primary key [Record] is a number type field
Thank you!
Code 1:
Private Sub cmdPrint_Click()
On Error GoTo Err_Handler
Dim stDocName As String
Dim stWhere As String
stDocName = "FormViewReport"
stWhere = "[Record] =" & Me![Record]
DoCmd.OpenReport stDocName, acViewNormal, , stWhere
Err_Exit:
Exit Sub
Err_Handler:
MsgBox Err.Description
Resume Err_Exit
Code 2:
Private Sub cmdPrint_Click()
Dim stWhere As String
If Me.Dirty Then
Me.Dirty=False
End If
If Me.NewRecord Then
MsgBox "Select a record to print"
Else
strWhere = "[Record] = " & Me.[Record]
DoCmd.OpenReport "FormViewReport", acViewNormal, , strWhere
End If
End Sub