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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need to click on sub report to view data

Status
Not open for further replies.

FlynnF

IS-IT--Management
Feb 13, 2012
5
0
0
IE
I am using access2007 and want to generate letters. I have designed a report with a subreport.. I am happy that the master/child links are in place. I want to make some fields within the subreport visible/not visible based on certain conditions when the main report is opened. At present I have to click on the subreport area of the report for these conditions to be applied. I've placed the visible true/false code in the on load event of the subreport which is obviously incorrect. My code is doing what I want it to do, unfortunately only when i click on subreport, not when the report is opened. Where should I be placing this code.

Any suggestions gratefully received.
 
Also, can you tell us what view you are viewing? You should be using the Print Preview and code should be in the On Format event of the report section you are modifying.

Duane
Hook'D on Access
MS Access MVP
 
the system is designed to record different projects details. each project has a marking scheme.applicants are invited to make submission for a project and they are then scored based on the specified marking scheme. this data is entered to tblproject, tblsubmission and tblmarkingscheme. projectID is the primary key in tblprojects that provides parent/childlinks

tblmarkingscheme has schemeid (PK) and projectid and room for 10 differnt categories. ie. schemeDesc1to10, MaxMarks1to10, Passmark1to10 and PassFailOnly1to10. a category could have a score or could be a straight pass or fail category so for example you could have the following:
cat1 - price - maxmarks 100, pass mark 90
cat2 - tax compliant - pass or fail only
cat3 - skill - maxmarks 100, pass mark 90
and so on for 10 categories.

so in my report i want to show the applicant score and how that compares to the marking scheme. the main report shows each applicant's scores. subreport1 shows the marking scheme for this project. subreport2 shows the winning appliant score. i have the following code in the on load event of the marking scheme subreport. i have similar code in the winning applicant report on load event.
If Me.MaxMarks1.Value = 0 Then
Me.MaxMarks1.Visible = False
End If
If Me.PassFail1.Value = -1 Then
Me.Lbpassfail1.Visible = True '(and so on for 10 categories)
End Sub

note passfail1-10 is a tick box on data entry. so on report if it is -1 i want to display lable with "Pass/Fail"
in theory i want the following:
if cat1 has max and pass marks i want to hide passfailonly1
if cat2 has passfail only i want to show passfailonly2 and hide totalmark2 and passmark2 and so on

again this code works when i click on the report in Report view. if i open in print preview it does not work

am i making very hard work of this?
 
dhookom - I tried the code in the on format event in the detail of the subreport but with the same results. ie the show/hide of certain fields only worked if i clicked on the subreport in report view and did not show/hide at all in print preview
is the were you mean for the code to go?

thanks again for your help with this
 
note also on my subbmission data entry forms if a category is passfail only, i hide maxmarks and passmarks. i then update these hidden fields to 0 so that all fields in a record are populated. users cannot move on to next record until all fields are populated. therefore there are no null fields in a record once any data has been entered
hence if maxmarks.value =0 then above
 
Sorry confusing myself at this stage. Disregard above. It should read that my tblmarkingscheme has 1-10 categories. I may not use all 10 for some projects but want all fields updated and the record locked once populated. If a category is not used I want it to have a max mark of 0 and a pass mark of 0 hence if me.maxmark.value=0 then......

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top