Report printing - Current record only

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

how do I get access to print a report for the current record only so I dont
have to see all the information ?

Thanks for the help.
 
Please search for your answer before posting. This is a very common
question...



Private Sub Print_Button_Click()

If (IsNull([UserID])) Then

' Verify the key field (UserID) has a selection

Exit Sub

End If

DoCmd.OpenReport "SomeReportName", acViewNormal, "","[UserID] =
Forms![frmSomeFormName]![UserID]"

End Sub
 
I added the following code as suggested, the fields or information about the
database is as follows
table name is = table1
form name = case
field with unique identifier is called = FDMS
report name is = ajustment

receiving the following error "Compile error , syntax error


Private Sub Command70_Click()
If (IsNull([FDMS])) Then

' Verify the key field (FDMS) has a selection

Exit Sub

End If

DoCmd.OpenReport "AJUSTMENT", acViewNormal, "", "[FDMS] ="
Forms![frmcase]![FDMS]"
 
terry said:
I added the following code as suggested, the fields or information about the
database is as follows
table name is = table1
form name = case
field with unique identifier is called = FDMS
report name is = ajustment

receiving the following error "Compile error , syntax error


Private Sub Command70_Click()
If (IsNull([FDMS])) Then

' Verify the key field (FDMS) has a selection

Exit Sub

End If

DoCmd.OpenReport "AJUSTMENT", acViewNormal, "", "[FDMS] ="
Forms![frmcase]![FDMS]"
 
Made to change you suggested, however the *** thing keeps putting the " on
the end , I did get it removed but when you execute to command button it
dosn't select or hold the current record, to be displayed in report. It
displays each record in the table

DL said:
terry said:
I added the following code as suggested, the fields or information about the
database is as follows
table name is = table1
form name = case
field with unique identifier is called = FDMS
report name is = ajustment

receiving the following error "Compile error , syntax error


Private Sub Command70_Click()
If (IsNull([FDMS])) Then

' Verify the key field (FDMS) has a selection

Exit Sub

End If

DoCmd.OpenReport "AJUSTMENT", acViewNormal, "", "[FDMS] ="
Forms![frmcase]![FDMS]"
----------------------------------------------
DoCmd.OpenReport "AJUSTMENT", acViewNormal, "", "[FDMS] =
Forms![frmcase]![FDMS]"

**NB the extra " after = **
 
You are placing code on a single line?

terry said:
Made to change you suggested, however the *** thing keeps putting the " on
the end , I did get it removed but when you execute to command button it
dosn't select or hold the current record, to be displayed in report. It
displays each record in the table

DL said:
terry said:
I added the following code as suggested, the fields or information
about
the
database is as follows
table name is = table1
form name = case
field with unique identifier is called = FDMS
report name is = ajustment

receiving the following error "Compile error , syntax error


Private Sub Command70_Click()
If (IsNull([FDMS])) Then

' Verify the key field (FDMS) has a selection

Exit Sub

End If

DoCmd.OpenReport "AJUSTMENT", acViewNormal, "", "[FDMS] ="
Forms![frmcase]![FDMS]"
----------------------------------------------
DoCmd.OpenReport "AJUSTMENT", acViewNormal, "", "[FDMS] =
Forms![frmcase]![FDMS]"

**NB the extra " after = **
 
Back
Top