Results 1 to 4 of 4
  1. #1
    cowboy is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Jan 2010
    Posts
    291

    Filling in blank textbox on a report.

    I have this code set up in the Detail_Format sub.

    background on report:
    Me!txtZA has the control source [Left Side Depth]
    Me!txtZB has the control source [Right Side Depth]

    What I want:
    If [Right Side Depth] is empty I want it to show the same depth as the left side

    Things I have tried:


    If IsNull(Me![Right Side Depth]) Then
    Me![Right Side DI Depth] = Me!txtZA.value
    End If

    If IsNull(Me![Right Side Depth]) Then
    Me![Right Side DI Depth] = Me![Left Side DI Depth]
    End If

    If IsNull(Me![Right Side Depth]) Then
    Me!txtZB.value = Me!txtZA.value
    End If

    Any help on this would be appreciated, thanks.

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 Access 2007
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Try:
    Code:
    If Len(Me.txtZB & "") = 0 Then
       Me.txtZB = Me.txtZA
    End If

  3. #3
    cowboy is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Jan 2010
    Posts
    291
    I recieved an error
    Run-time error '-2147352567 (80020009)':
    You can't assign a value to this object.

  4. #4
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 Access 2007
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    D'oh! You can't write to a bound control in a report! How about creating an unbound control and use similar code to populate it?
    If Len(Me.txtZB & "") = 0 Then
    Me.txtZC = Me.txtZA
    Else
    Me.txtZC = Me.txtZB
    End If

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

Similar Threads

  1. Hiding rows when blank in a report.
    By ser01 in forum Reports
    Replies: 0
    Last Post: 02-27-2010, 10:29 PM
  2. Report printing unknown blank lines.
    By dgrzalja in forum Reports
    Replies: 10
    Last Post: 11-02-2009, 12:21 PM
  3. Keeping text in a report textbox
    By Hawkx1 in forum Reports
    Replies: 2
    Last Post: 11-13-2008, 04:11 PM
  4. Report will not print a bound textbox
    By vvrt in forum Reports
    Replies: 0
    Last Post: 03-16-2006, 02:16 PM
  5. report prints blank page at end of report
    By darrellx in forum Forms
    Replies: 0
    Last Post: 03-14-2006, 08:51 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