Solved

Help with reports Detail_format

Posted on 2013-11-12
2
458 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

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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 tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

803 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