Results 1 to 6 of 6

Thread: Report problems

  1. #1
    Join Date
    Dec 2003
    Posts
    3

    Unanswered: Report problems

    Ok, here is the problem. I set my database to search for a pupil within a query. Simple enough. I then want to search for a pupil and it open up in a report, no problem again.

    Here is the real problem. I have a database with 500 pupils and i can search for a pupil and it will load up in a report with all his grades and comments for each lesson. However, pupils take options so they will have blank fields in Report. How can I make it that if that pupil does not take music, the music text box will not show up? I think it may have to do with On No Data but i have never used Event Procedures before.

    Does that make sense at all? Or have i just spat it all out and it is nonsense? I also have never used SQL or any sort of programming in Access before so i need telling like a child, what to do, what to open to put the code in e.t.c.

    VERY much appreciate any help as this is the only problem holding up the finish date.

    Thank you

  2. #2
    Join Date
    Dec 2003
    Location
    WA, USA
    Posts
    51

    Re: Report problems

    open your report in design view and in the Detail Properties set
    Can Grow = Yes
    Can Shrink = Yes
    Then for the text boxes that can contain empty data set the same properties:
    Can Grow = Yes
    Can Shrink = Yes

    In essance this alows the text fields to shrink or grow (Verticaly) bassed upon the amount of data supplied.

    Does that help?
    Bob

  3. #3
    Join Date
    Dec 2003
    Posts
    3
    that is great thanks. What about the Labels in the report?

  4. #4
    Join Date
    Dec 2003
    Location
    Colorado
    Posts
    24
    Give this a spin :

    Select the detail section of your report, right click then select "Build Event" This will open the coding for your report.

    Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
    If (Me![SubjectField]) = "" Then
    txtGrade.Visible = False
    lblGrade.Visible = False
    Else
    txtGrade.Visible = True
    lblGrade.Visible = True
    End If
    End Sub

    I hope this helps.
    Ray Burrows

  5. #5
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1

    Re: Report problems

    Originally posted by Redda
    Ok, here is the problem. I set my database to search for a pupil within a query. Simple enough. I then want to search for a pupil and it open up in a report, no problem again.

    Here is the real problem. I have a database with 500 pupils and i can search for a pupil and it will load up in a report with all his grades and comments for each lesson. However, pupils take options so they will have blank fields in Report. How can I make it that if that pupil does not take music, the music text box will not show up? I think it may have to do with On No Data but i have never used Event Procedures before.

    Does that make sense at all? Or have i just spat it all out and it is nonsense? I also have never used SQL or any sort of programming in Access before so i need telling like a child, what to do, what to open to put the code in e.t.c.

    VERY much appreciate any help as this is the only problem holding up the finish date.

    Thank you
    You can do that in the QUERY using IIF
    lMusic: iff(music, music,"") then in the report, use the lMusic field insted of muisc

  6. #6
    Join Date
    Dec 2003
    Posts
    3
    Ok i have tried using the the text. Please let me know where i am going wrong. As i said, not used VB before

    Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
    If (Report_find![SubjectField]) = "" Then ///////// Report_find pupil is the name of our report. But i am unsure what subject field will be in relation too? Is it going to be the query, table, report or a report label??///////

    Art reports.Target Grade_Label.Visible = False//////Art reports (e.t.c.) is the name of our label. I presume this is correct and it is the line before that is incorrect.
    Else
    Art reports.Target Grade_Label.Visible = True
    End If
    End Sub


    Any extra help would greatly be appreciated. Is report find correct or should i be refering to a table and what will be subject field??


    Thanks
    Redda

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •