Solved

Help with reports Detail_format

Posted on 2013-11-12
2
453 Views
Last Modified: 2013-11-12
Hello, I'm trying to use the following to conditionally populate a txt box on a report.

I'm getting the error: you can't assign a value to this object

What is the method and syntax to do this sort of thing in Access VBA?


Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)

    If CCur(Me.txt_ExtCostSubTotal) > CCur(50) Then
    Me.txt_Administration = 500
    Else
    Me.txt_ExtCostSubTotal = 0
    End If
     
   
End Sub
0
Comment
Question by:gogetsome
2 Comments
 
LVL 61

Accepted Solution

by:
mbizup earned 500 total points
ID: 39643200
Those textboxes might be non updateable for a variety of reasons (can't tell from what you have posted).

Try creating two new textboxes, txt_AdministrationNew and txt_ExtCostSubTotalNew (make sure they appear in the same report section as the originals) and set their controlsource properties as follows, using the = signs:


For txt_AdministrationNew:

  =  IIf (CCur(Me.txt_ExtCostSubTotal) > CCur(50), 500, txt_Administration)
   

And for txt_ExtCostSubTotalNew:

   =  IIf (CCur(txt_ExtCostSubTotal) > CCur(50), txt_ExtCostSubTotal, 0)


And see whether those boxes show what you are looking for.
0
 

Author Closing Comment

by:gogetsome
ID: 39643292
So many differences between .Net and Access. Thank you once again for you help.
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

In Debugging – Part 1, you learned the basics of the debugging process. You learned how to avoid bugs, as well as how to utilize the Immediate window in the debugging process. This article takes things to the next level by showing you how you can us…
I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now