Results 1 to 6 of 6
  1. #1
    joecamel9166 is offline Advanced Beginner
    Windows 10 Access 2013 64bit
    Join Date
    Feb 2016
    Posts
    85

    Fields Not Showing On Report

    On one of my forms, when I run the save button I have 2 labels print out.
    Field [Unit] is the main key in my main table.

    below is the code I am using to print these labels:

    Code:
    Select Case MsgBox("Do you Want To Print RSO Labels?", vbYesNo, "Warning")
    Case vbYes
    DoCmd.OpenReport "rptRSOLabel", acViewNormal, , "[Unit] = " & [Unit], acWindowNormal
          
    DoCmd.OpenReport "rptAccessory", acViewNormal, , "[Unit] = " & [Unit], acWindowNormal
          
    Case vbNo
    End Select
    The problem is that "rptRSOLabel" prints the [Unit] number sometimes. About 1/10 times the number doesnt print.

    The part that really confuses me is that "rptAccessory" prints the [Unit] number consistently.

    Any input on this would be helpful.

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,515
    if the code runs on a form,
    and the textbox is called unit
    and the UNIT is numeric:

    DoCmd.OpenReport "rptRSOLabel", acViewNormal, , "[Unit] = " & me.Unit


    if TEXT:
    DoCmd.OpenReport "rptRSOLabel", acViewNormal, , "[Unit] = '" & me.Unit & "'"


  3. #3
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,795
    What is the RecordSource of rptRSOLabel?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  4. #4
    joecamel9166 is offline Advanced Beginner
    Windows 10 Access 2013 64bit
    Join Date
    Feb 2016
    Posts
    85
    @Ranman256 Will try this in the morning and see if this works. still dont see how it works some times and not other times.

    @June7 the record source is tblUnits which is my main table. Both reports pull the data from [Unit] from tblUnits, although rptAccessories also gets data from another table. The form this runs on is the first form when entering data. On load [Unit] is generated. So by the time this command is executed [Unit] is already populated in the tblUnits.

  5. #5
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,795
    If you want to provide db for analysis, follow instructions at bottom of my post.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  6. #6
    joecamel9166 is offline Advanced Beginner
    Windows 10 Access 2013 64bit
    Join Date
    Feb 2016
    Posts
    85
    So I changed the code to:

    DoCmd.OpenReport "rptRSOLabel", acViewNormal, , "[Unit] = " & me.Unit

    It worked for about 50 entries, so I marked this as solved, now it just printed a label without the Unit number on it.

    Any ideas?

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

Similar Threads

  1. Replies: 1
    Last Post: 07-16-2018, 02:49 PM
  2. Replies: 15
    Last Post: 04-16-2014, 01:15 PM
  3. Report not showing some fields
    By Ruegen in forum Programming
    Replies: 2
    Last Post: 11-25-2013, 11:37 AM
  4. Replies: 1
    Last Post: 06-26-2013, 09:17 AM
  5. Report showing non-visible fields
    By AKQTS in forum Forms
    Replies: 2
    Last Post: 09-21-2010, 09:40 AM

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