Solved

Help with reports Detail_format

Posted on 2013-11-12
2
466 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone 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

In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
Microsoft Access is a place to store data within tables and represent this stored data using multiple database objects such as in form of macros, forms, reports, etc. After a MS Access database is created there is need to improve the performance and…
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…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

635 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