I need an unbound box on my report that will say "WARNING" if a bound box has a total that is above a certain amount
example: if the total weight in the weight box is above 10,000 lbs I need a warning
I tried IF but got no value
Thanks
I need an unbound box on my report that will say "WARNING" if a bound box has a total that is above a certain amount
example: if the total weight in the weight box is above 10,000 lbs I need a warning
I tried IF but got no value
Thanks
Where, in your report, does the weight box reside. Is it in a detail, header, or.. ? What is the name of the detail, header, or.... ?
What is the name of the detail?
Click the detail to highlight the detail. Check the detail's properties "Other" tab and post the name of said detail here, in this thread.
Date Check Box = Date check
Unbound box = Text 26
The Date Check is a number the Outbound box needs to say "Warning" if the date check box has a total of more than 800
Assuming the name of the detail section in your report is "Detail" and both TextBoxes are in this detail, you can place the following in your Detail's Format event of the VBA editor.
It is advisable to avoid spaces in names of fields.Code:If Me.Date_check.Value >= 801 Then Me.Text_26.Value = "WARNING" Else Me.Text_26.Value = "" End If
Alternatively, you can place an IIf statement within your unbound Text 26. You can search for examples of IIf statements and get help in the VBA editor's help files.
It is not a bad idea to become familiar with details, headers, footers, and such when using reports. Reports are great tools for handling things like calculations. If you don't know the name of a detail and how it relates to various controls on your report, you are limiting your ability to exploit the reports possible features.
I tend to put these types of calculations in the query for the report/form. In the query, you could add a column
Then add the (calculated) field to the report.Code:txtWarn: IIF(YourWeightFieldName>10000, "Warning","")