Solved

Help with reports Detail_format

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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Regardless of which version on MS Access you are using, one of the harder data-entry forms to create is one where most data from previous entries needs to be appended to new records, especially when there are numerous fields and records involved.  W…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

829 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