Report detail not displaying

G

Guest

Hi,

I have gone through all the posts for previewing and printing just the
report that relates to the current record on the form. Even set of code I
put in seems to bring up the report and then everything on the report except
the title dissappears.

Basically I would just want to preview, save, email or print the current
record in a report. Can someone please tell me how to do this.

To help here are some field details:
My report is called "rptTechnicalRequest"
The PrimaryKey for my form records is "TaskID" but this form is a subform on
the form "Projects" with the PrimaryKey "ProjectID"

Can someone please help??
 
D

Duane Hookom

What is the record source of the report? What code are you using to open it?
How is the report limited to the current record?
 
G

Guest

I hope the information below helps you:

Main Form
Based on tblProject
Primary Key - ProjectID

SubForm
Based on tblTask
Primary Key - TaskID

Main Report
Record Source - tblProject

SubForm
Record Source - tblTask

On the subform I have a command button with the following Event:

Private Sub Command44_Click()
DoCmd.OpenReport "rptTechnicalRequest", acPreview
Reports![rptTechnicalRequest].Filter = "TaskID = " & Me![TaskID]
Reports![rptTechnicalRequest].FilterOn = True
End Sub

Any ideas on how to change it to just open the current task? Now it opens
all tasks to do with the current project.
 
G

Guest

I hope the information below helps you:

Main Form
Based on tblProject
Primary Key - ProjectID

SubForm
Based on tblTask
Primary Key - TaskID

Main Report
Record Source - tblProject

SubForm
Record Source - tblTask

On the subform I have a command button with the following Event:

Private Sub Command44_Click()
DoCmd.OpenReport "rptTechnicalRequest", acPreview
Reports![rptTechnicalRequest].Filter = "TaskID = " & Me![TaskID]
Reports![rptTechnicalRequest].FilterOn = True
End Sub

Any ideas on how to change it to just open the current task? Now it opens
all tasks to do with the current project.
 
G

Guest

I hope the information below helps you:

Main Form
Based on tblProject
Primary Key - ProjectID

SubForm
Based on tblTask
Primary Key - TaskID

Main Report
Record Source - tblProject

SubForm
Record Source - tblTask

On the subform I have a command button with the following Event:

Private Sub Command44_Click()
DoCmd.OpenReport "rptTechnicalRequest", acPreview
Reports![rptTechnicalRequest].Filter = "TaskID = " & Me![TaskID]
Reports![rptTechnicalRequest].FilterOn = True
End Sub

Any ideas on how to change it to just open the current task? Now it opens
all tasks to do with the current project.
 
D

Duane Hookom

First, you need to make sure the record is saved prior to printing. Are you
actually printing a subform on your main report or is this a subreport? Did
you set the Link Master/Detail of the subreport control?

Also, your code filters by TaskID which I would not expect to be in the
Record Source of the main report, only the subreport. If the main report
actually has a TaskID in its field list then consider using code like:

Private Sub Command44_Click()
Dim strWhere as String
Me.Dirty = False 'save the record
strWhere = "TaskID = " & Me![TaskID]
DoCmd.OpenReport "rptTechnicalRequest", acPreview, , strWhere
End Sub

--
Duane Hookom
MS Access MVP

Nikki said:
I hope the information below helps you:

Main Form
Based on tblProject
Primary Key - ProjectID

SubForm
Based on tblTask
Primary Key - TaskID

Main Report
Record Source - tblProject

SubForm
Record Source - tblTask

On the subform I have a command button with the following Event:

Private Sub Command44_Click()
DoCmd.OpenReport "rptTechnicalRequest", acPreview
Reports![rptTechnicalRequest].Filter = "TaskID = " & Me![TaskID]
Reports![rptTechnicalRequest].FilterOn = True
End Sub

Any ideas on how to change it to just open the current task? Now it opens
all tasks to do with the current project.



Duane Hookom said:
What is the record source of the report? What code are you using to open
it?
How is the report limited to the current record?
 
G

Guest

Hi,

I tried that code and it still brought up a blank report.

Duane Hookom said:
First, you need to make sure the record is saved prior to printing. Are you
actually printing a subform on your main report or is this a subreport? Did
you set the Link Master/Detail of the subreport control?

Also, your code filters by TaskID which I would not expect to be in the
Record Source of the main report, only the subreport. If the main report
actually has a TaskID in its field list then consider using code like:

Private Sub Command44_Click()
Dim strWhere as String
Me.Dirty = False 'save the record
strWhere = "TaskID = " & Me![TaskID]
DoCmd.OpenReport "rptTechnicalRequest", acPreview, , strWhere
End Sub

--
Duane Hookom
MS Access MVP

Nikki said:
I hope the information below helps you:

Main Form
Based on tblProject
Primary Key - ProjectID

SubForm
Based on tblTask
Primary Key - TaskID

Main Report
Record Source - tblProject

SubForm
Record Source - tblTask

On the subform I have a command button with the following Event:

Private Sub Command44_Click()
DoCmd.OpenReport "rptTechnicalRequest", acPreview
Reports![rptTechnicalRequest].Filter = "TaskID = " & Me![TaskID]
Reports![rptTechnicalRequest].FilterOn = True
End Sub

Any ideas on how to change it to just open the current task? Now it opens
all tasks to do with the current project.



Duane Hookom said:
What is the record source of the report? What code are you using to open
it?
How is the report limited to the current record?

--
Duane Hookom
MS Access MVP

Hi,

I have gone through all the posts for previewing and printing just the
report that relates to the current record on the form. Even set of
code I
put in seems to bring up the report and then everything on the report
except
the title dissappears.

Basically I would just want to preview, save, email or print the
current
record in a report. Can someone please tell me how to do this.

To help here are some field details:
My report is called "rptTechnicalRequest"
The PrimaryKey for my form records is "TaskID" but this form is a
subform
on
the form "Projects" with the PrimaryKey "ProjectID"

Can someone please help??
 
D

Duane Hookom

I asked two questions and made several suggestions and you only suggest it
didn't work. If you need assistance, you need to provide some basic feedback
and information so others can help.

--
Duane Hookom
MS Access MVP

Nikki said:
Hi,

I tried that code and it still brought up a blank report.

Duane Hookom said:
First, you need to make sure the record is saved prior to printing. Are
you
actually printing a subform on your main report or is this a subreport?
Did
you set the Link Master/Detail of the subreport control?

Also, your code filters by TaskID which I would not expect to be in the
Record Source of the main report, only the subreport. If the main report
actually has a TaskID in its field list then consider using code like:

Private Sub Command44_Click()
Dim strWhere as String
Me.Dirty = False 'save the record
strWhere = "TaskID = " & Me![TaskID]
DoCmd.OpenReport "rptTechnicalRequest", acPreview, , strWhere
End Sub

--
Duane Hookom
MS Access MVP

Nikki said:
I hope the information below helps you:

Main Form
Based on tblProject
Primary Key - ProjectID

SubForm
Based on tblTask
Primary Key - TaskID

Main Report
Record Source - tblProject

SubForm
Record Source - tblTask

On the subform I have a command button with the following Event:

Private Sub Command44_Click()
DoCmd.OpenReport "rptTechnicalRequest", acPreview
Reports![rptTechnicalRequest].Filter = "TaskID = " & Me![TaskID]
Reports![rptTechnicalRequest].FilterOn = True
End Sub

Any ideas on how to change it to just open the current task? Now it
opens
all tasks to do with the current project.



:

What is the record source of the report? What code are you using to
open
it?
How is the report limited to the current record?

--
Duane Hookom
MS Access MVP

Hi,

I have gone through all the posts for previewing and printing just
the
report that relates to the current record on the form. Even set of
code I
put in seems to bring up the report and then everything on the
report
except
the title dissappears.

Basically I would just want to preview, save, email or print the
current
record in a report. Can someone please tell me how to do this.

To help here are some field details:
My report is called "rptTechnicalRequest"
The PrimaryKey for my form records is "TaskID" but this form is a
subform
on
the form "Projects" with the PrimaryKey "ProjectID"

Can someone please help??
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top