Results 1 to 9 of 9
  1. #1
    PhilTFC is offline Novice
    Windows Vista Access 2007
    Join Date
    Jan 2012
    Posts
    14

    Field visibility in a report

    I am using Access 2007 and have a question for my report.
    If a field has a null value on my report how can i make the field not show in print view? but when there is a figure then the field will show on the report.

    the control source is CARRIAGE and the label is Label39

    i was trying to do a if then else statement but not having much luck



    Thank you in advance

  2. #2
    alansidman's Avatar
    alansidman is offline VIP
    Windows 7 32bit Access 2010 32bit
    Join Date
    Apr 2010
    Location
    Steamboat Springs
    Posts
    2,529
    You could try this:
    Code:
    Private Sub Report_Load()
    If IsNull(Me.Text0) Then
    Me.Text0.Visible = False
    End If
    End Sub
    Be sure to change the names of your controls and reports to reflect your db.

  3. #3
    PhilTFC is offline Novice
    Windows Vista Access 2007
    Join Date
    Jan 2012
    Posts
    14
    Thank you for your quick reply. I know it is something obvious but i cant see what it is.. the field is not visible on the whole report, this is the VBA i used

    Private Sub Report_Load()
    If IsNull(Me.Text122) Then
    Me.Text122.Visible = False
    End If
    End Sub

  4. #4
    alansidman's Avatar
    alansidman is offline VIP
    Windows 7 32bit Access 2010 32bit
    Join Date
    Apr 2010
    Location
    Steamboat Springs
    Posts
    2,529
    I mis understood your request. I assumed (my bad) that you had only one record per report. This bit of code says that if any record is null upon loading then the control is not visible.

    Is each record on a separate page of the report. Not sure if doing a load on a page (even if it is available) would work. Need to rethink. Hopefully, someone with a little more expertise on reports will jump in here.

    Alan

  5. #5
    alansidman's Avatar
    alansidman is offline VIP
    Windows 7 32bit Access 2010 32bit
    Join Date
    Apr 2010
    Location
    Steamboat Springs
    Posts
    2,529
    I did a google search on "MS Access Reports Hide Empty Fields" and found this

    http://en.allexperts.com/q/Using-MS-...pty-fields.htm

  6. #6
    PhilTFC is offline Novice
    Windows Vista Access 2007
    Join Date
    Jan 2012
    Posts
    14
    i am creating an invoice summary which has multiple fields for different customers. thank you for your help and replying so quick.

  7. #7
    PhilTFC is offline Novice
    Windows Vista Access 2007
    Join Date
    Jan 2012
    Posts
    14
    Awesome!! thank you for taking the time to do a search

  8. #8
    PhilTFC is offline Novice
    Windows Vista Access 2007
    Join Date
    Jan 2012
    Posts
    14
    not sure how to mark it "solved"

  9. #9
    alansidman's Avatar
    alansidman is offline VIP
    Windows 7 32bit Access 2010 32bit
    Join Date
    Apr 2010
    Location
    Steamboat Springs
    Posts
    2,529
    At the top of the first thread. Thread tools. Marked it for you.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Field Visibility
    By cbrsix in forum Programming
    Replies: 3
    Last Post: 06-27-2012, 03:52 PM
  2. subform visibility
    By nichmeg in forum Forms
    Replies: 9
    Last Post: 11-04-2011, 12:22 PM
  3. Visibility based on Combo selection
    By jlclark4 in forum Forms
    Replies: 1
    Last Post: 12-22-2010, 11:42 AM
  4. Visibility of other controls
    By jlclark4 in forum Forms
    Replies: 7
    Last Post: 12-15-2010, 12:34 PM
  5. Replies: 0
    Last Post: 11-24-2009, 03:23 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums