Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Current Report Headers...

Status
Not open for further replies.

leslied

MIS
May 29, 2003
108
US
Hi guys,

I have a report that apparently was working up until some time ago. The problem:

Certain Labels are not being viewed. For example, in the Report Header, when the report is viewed whatever is in the report header is not viewable. The properties for it is set to view-yes, but I still am not able to view it on the preview...

Any ideas? kind of urgent....sorry for the urgentness, if thier is such a word. New to this whole access series.

Thank guys
 
I have a report that apparently was working up until some time ago. The problem:


If you were able to view in the report that what you expected and then suddenly stopped showing certain items in the report header, it is possible that the report became corrupted.

An investment in knowledge always pays the best dividends.

by Benjamin Franklin
 
Are you looking at the first page?
Report headers are only shown there, starting with page two you only get page headers, NOT report headers.

Have you compacted/repaired?

Have you checked the visible property for the control to be yes?
 
Ok Mr Jackson here is the scenario:

when i view the report, the first page is suppose to come up with the name of the report on it correct: The name of the report appears on a scetion that reads:Report Header. Thats the first area that i checked to make sure that the visible property is set to view or yes. There is nothing else in that part. I can't see it in the preview. In the PageHeader area I have the same problem with a few of the parameters on there. I can anly see 1 out of about 9 other parameters on their.

Hope this helps you to understand the situation.

Help?

Please...thanks
 
Please understand I'm trying to assist without seeing what you're seeing.

Finding problems is usually a process of elimination.

First, bring up the report in print preview.
In preview mode, from the toolbar at the top,
select View / Pages / Four
When you see multiple pages at once, the problem may become apparent.

Also, actually print a few pages. You can do that by selecting File / print. When the menu opens, just print pages 1 - 4, for example. That often helps because what the printer does isn't always a match to print preview on your monitor.

What you may have is a change to the margins. If a report design calls for a page larger than fits on your printer or paper, that usually results in some blank pages being printed. (It's a reaction by the printer driver.)

Next, how long was the report working correctly?
(A year, a month, a day?)
If it's only been operational a short time, that
suggests it may not be a new problem, but a design flaw
brought out when fed live data.

I'll wait for your response to the above.

Also, while I can't speak for others here, I AM a volunteer. I use this for answers to my questions, but I'm on my employer's clock. I.E., I'll help as much as I can, but please understand that my time is limited.

Bob
 
Point taken Bob, As I am sure that most of us on here are probab;y under some constraints just as you and I. Anyhow,
I looked over your points. I have done all of the above and none of them really show me where the problems lie. I don't really have a problem w/ margins as such. I already fixed problem as that was one problem. Let me see if I can make it just a bit clearer. The report looks like this in Design View:

ReportHeader_______________________________________________

Commonwealth of the Governemnt of Dominica
____________________________________________________________
PageHeader

Another Label under here...
____________________________________________________________
when I preview the report, I can't see anything in the Report Header nor in the Page Header. I have looked at the visible propertyies and they are set to yes... thus the stomp! at least on my part. According to my colleagues, the report was working until yesterday...

Please keep in mund I did not write this said report. I just got it since I am currently around.... I hope you understand the scenario. Thanks for your help Bob I really appreciate your candidness towards this. To you others guys aswell.
 
Try creating a new report and call it rptTEST (something like that). Then make a lable in the header and page of the report. Instead of using the exact wording you have, try something else. Don't attach the report to anything, ie a query, table etc. You might also look to see what the code is behind the button that opens your current report. If the problem still exists, then you have an Access problem, otherwise it is a report problem.

As Bob indicated, trying to diagnose something without seeing is extremely difficult. It sometimes becomes a process of elimination.

For Bob ---- I get paid twice as much as you do volunteering (2 X 0 = 0)

An investment in knowledge always pays the best dividends.

by Benjamin Franklin
 
That was funny....

the Bob joke...i.e.

Any how I really appreciate you alls input.

Thank you very much.

Let the elimination begin....

later
 
You are welcome! - I wish we'd figured this out, already.

Also, is the report fed by a query?
If so, run the query by itself and see what it pulls.

What about the rest of report? Is detail showing as expected? Any chance the PC's date has been changed?

Bob
 
This is the code for the form which calls the report:

See if anyone of you can see a problem in this code, thanks



Option Compare Database


Private Sub GroupFooter2_Format(Cancel As Integer, FormatCount As Integer)
rpt_tot_rec_exp_lbl.Visible = False
rpt_tot_cap_exp_lbl.Visible = False
rpt_tot_rec_rev_lbl.Visible = False
rpt_tot_cap_rev_lbl.Visible = False

If soc_chr = 1 Then
rpt_tot_rec_rev_lbl.Visible = True
Else
If soc_chr = 2 Then
rpt_tot_cap_rev_lbl.Visible = True
Else
If soc_chr = 3 Then
rpt_tot_rec_exp_lbl.Visible = True
Else
If soc_chr = 4 Then
rpt_tot_cap_exp_lbl.Visible = True
End If
End If
End If
End If

End Sub


Private Sub PageHeaderSection_Format(Cancel As Integer, FormatCount As Integer)

'rpt_rec_rev_lbl.Visible = False
'rpt_cap_rev_lbl.Visible = False
'rpt_rec_exp_lbl.Visible = False
'rpt_cap_exp_lbl.Visible = False

If soc_chr = 1 Then
'rpt_rec_rev_lbl.Visible = True
Else
If soc_chr = 2 Then
'rpt_cap_rev_lbl.Visible = True
Else
If soc_chr = 3 Then
'rpt_rec_exp_lbl.Visible = True

Else
If soc_chr = 4 Then
'rpt_cap_exp_lbl.Visible = True
End If
End If
End If
End If

End Sub
Private Sub ReportFooter_Format(Cancel As Integer, FormatCount As Integer)
'rpt_exp_acct_lbl.Visible = False
'rpt_rev_acct_lbl.Visible = False

If soc_chr = 1 Or soc_chr = 2 Then
'rpt_rev_acct_lbl.Visible = True
Else
If soc_chr = 3 Or soc_chr = 4 Then
'rpt_exp_acct_lbl.Visible = True
End If
End If

End Sub
Private Sub Report_Activate()

End Sub

Private Sub Report_Open(Cancel As Integer)

Dim rpt_type As String

rpt_type = Forms![Report Parameters]![frm_acct_type]
rpt_rev_mnth_abs_lbl.Visible = False
rpt_exp_mnth_abs_lbl.Visible = False
tot_rev_to_date_lbl.Visible = False
tot_exp_to_date_lbl.Visible = False


If rpt_type = "I" Then
rpt_rev_mnth_abs_lbl.Visible = True
tot_rev_to_date_lbl.Visible = True
Else
If rpt_type = "E" Then
rpt_exp_mnth_abs_lbl.Visible = True
tot_exp_to_date_lbl.Visible = True
End If
End If

End Sub

Private Sub ReportHeader_Format(Cancel As Integer, FormatCount As Integer)
Label315.Visible = True
End Sub
 
Correction....

That last code was the code for the Report itself.

The following is the code for the Form which calls the above report:



Function exec_report_qry_46()
Dim szSubs() As String
Dim Dummy As Integer
Dim Ret As Integer

'Dim db As Database
'Dim MyQuery As QueryDef
Dim MyRecord As Recordset

Dim account_type As String
Dim financial_year As Integer
Dim period As Integer

Set form_g = Screen.ActiveForm
report_type = form_g.[frm_rpt_name]
account_type = form_g.[frm_acct_type]
financial_year = form_g.[frm_fin_yr]
period = form_g.[frm_period]

DoCmd.Hourglass True

Set db = DBEngine.Workspaces(0).Databases(0)
Set MyQuery = db.QueryDefs("DCA_account_detail")
MyQuery.Properties("sql") = "Execute DCA_account_detail" & " " & financial_year & "," & Chr(34) & account_type & Chr(34) & "," & period
DoCmd.OpenQuery "DCA_account_detail", acViewNormal, acReadOnly

DoCmd.Hourglass False

End Function
Function exec_report_qry()
Dim szSubs() As String
Dim Dummy As Integer
Dim Ret As Integer

'Dim db As Database
'Dim MyQuery As QueryDef
Dim MyRecord As Recordset

Dim account_type As String
Dim financial_year As Integer
Dim period As Integer

Set form_g = Screen.ActiveForm
report_type = form_g.[frm_rpt_name]
account_type = form_g.[frm_acct_type]
financial_year = form_g.[frm_fin_yr]
period = form_g.[frm_period]

DoCmd.Hourglass True

Set db = DBEngine.Workspaces(0).Databases(0)
Set MyQuery = db.QueryDefs("DCA_account_detail")
MyQuery.Properties("sql") = "Execute DCA_account_detail" & " " & financial_year & "," & Chr(34) & account_type & Chr(34) & "," & period
DoCmd.OpenQuery "DCA_account_detail", acViewNormal, acReadOnly

If report_type = "RE 50" Then
Set MyQuery = db.QueryDefs("DCA_posted_jrnl_debit")
MyQuery.Properties("sql") = "Execute DCA_posted_jrnl_debit_1" & " " & financial_year & "," & period
DoCmd.OpenQuery "DCA_posted_jrnl_debit", acViewNormal, acReadOnly

Set MyQuery = db.QueryDefs("DCA_posted_jrnl_credit")
MyQuery.Properties("sql") = "Execute DCA_posted_jrnl_credit_1" & " " & financial_year & "," & period
DoCmd.OpenQuery "DCA_posted_jrnl_credit", acViewNormal, acReadOnly
End If
DoCmd.Hourglass False

End Function


Private Sub frm_fin_yr_AfterUpdate()
frm_period.Value = Null
frm_period.Requery
End Sub

Private Sub frm_preview_rpt_Click()
On Error GoTo Err_frm_preview_rpt_Click

Dim stDocName As String

stDocName = Forms![Report Parameters]![frm_rpt_name]

Call exec_report_qry
DoCmd.OpenReport stDocName, acPreview

Exit_frm_preview_rpt_Click:
Exit Sub

Err_frm_preview_rpt_Click:
MsgBox Err.Description
Resume Exit_frm_preview_rpt_Click

End Sub

Private Sub frm_prnt_rpt_Click()
On Error GoTo Err_frm_prnt_rpt_Click

Dim stDocName As String

Call exec_report_qry
stDocName = Forms![Report Parameters]![frm_rpt_name]

DoCmd.OpenReport stDocName, acNormal

Exit_frm_prnt_rpt_Click:
Exit Sub

Err_frm_prnt_rpt_Click:
MsgBox Err.Description
Resume Exit_frm_prnt_rpt_Click

End Sub

Private Sub frm_close_Click()
On Error GoTo Err_frm_close_Click


DoCmd.Quit

Exit_frm_close_Click:
Exit Sub

Err_frm_close_Click:
MsgBox Err.Description
Resume Exit_frm_close_Click

End Sub

Private Sub frm_refresh_Click()
On Error GoTo Err_frm_refresh_Click


DoCmd.DoMenuItem acFormBar, acRecordsMenu, 5, , acMenuVer70

Exit_frm_refresh_Click:
Exit Sub

Err_frm_refresh_Click:
MsgBox Err.Description
Resume Exit_frm_refresh_Click

End Sub

Private Sub frm_rpt_name_Change()
frm_acct_type.Value = Null
frm_fin_yr.Value = Null
frm_period = Null
End Sub

Private Sub Close_Click()
On Error GoTo Err_Close_Click


DoCmd.Close

Exit_Close_Click:
Exit Sub

Err_Close_Click:
MsgBox Err.Description
Resume Exit_Close_Click

End Sub



Thanks again guys...
 
I only glanced at the code, don't have that much time. However, the lable in the headers indicate to make visable or not based on certain criteria. Can you open the report by itself without using the button???

An investment in knowledge always pays the best dividends.

by Benjamin Franklin
 
Wow,
This brings back memories...
Vivid picture of my first ride on a bicycle WITHOUT training wheels. Meaning your report is more complex than anything I've worked on to date.

But, did you know that ' (apostrophe) turns a Visual Basic coding line into a comment?

Look at the following cut/paste from your post above:


Option Compare Database

Private Sub GroupFooter2_Format(Cancel As Integer, FormatCount As Integer)
rpt_tot_rec_exp_lbl.Visible = False
rpt_tot_cap_exp_lbl.Visible = False
rpt_tot_rec_rev_lbl.Visible = False
rpt_tot_cap_rev_lbl.Visible = False

If soc_chr = 1 Then
rpt_tot_rec_rev_lbl.Visible = True
Else
If soc_chr = 2 Then
rpt_tot_cap_rev_lbl.Visible = True
Else
If soc_chr = 3 Then
rpt_tot_rec_exp_lbl.Visible = True
Else
If soc_chr = 4 Then
rpt_tot_cap_exp_lbl.Visible = True
End If
End If
End If
End If

End Sub


Private Sub PageHeaderSection_Format(Cancel As Integer, FormatCount As Integer)

----------------------------------------------------------
Bob-The following lines that start with '
are no longer operational. Appears to me you NEED
the ones that state .Visible = True to make the labels show up. Don't see why they were commented. Maybe the code was being tested and accidently got saved by mistake.
----------------------------------------------------------
'rpt_rec_rev_lbl.Visible = False
'rpt_cap_rev_lbl.Visible = False
'rpt_rec_exp_lbl.Visible = False
'rpt_cap_exp_lbl.Visible = False

If soc_chr = 1 Then
'rpt_rec_rev_lbl.Visible = True
Else
If soc_chr = 2 Then
'rpt_cap_rev_lbl.Visible = True
Else
If soc_chr = 3 Then
'rpt_rec_exp_lbl.Visible = True

Else
If soc_chr = 4 Then
'rpt_cap_exp_lbl.Visible = True
End If
End If
End If
End If

End Sub
Private Sub ReportFooter_Format(Cancel As Integer, FormatCount As Integer)
'rpt_exp_acct_lbl.Visible = False
'rpt_rev_acct_lbl.Visible = False

If soc_chr = 1 Or soc_chr = 2 Then
'rpt_rev_acct_lbl.Visible = True
Else
If soc_chr = 3 Or soc_chr = 4 Then
'rpt_exp_acct_lbl.Visible = True
End If
End If
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top