alarm text box

bakerboy_1111

Registered User.
Local time
Today, 17:22
Joined
Dec 1, 2003
Messages
43
Does anybody know how I can create a text box, or label box, or something that displays a message only if certain criteria are satified?

Something like a text box that is only active if something is true.
 
What's the criteria and how does it work?

What you want will determine which event to put the code in for what you want if, indeed, you need code at all
 
The form I've created sorts cables into drums.

On my form I have a list box called "Capacity" which gives the capacity for the selected drum, and another list box called "Total_Length" which sums the length of the cables in a particular drum.

When the total length value exceeds the capacity value, I wish to display the text, "WARINING! Total cable length exceeds drum capacity".

Rather than have a pop up message box, I hoped I would be able to have it display on the actual form, like in a text box or something. That way I can put it in a specific place on the form and change the font to red etc, so it is noticed easily.


Do you know how to do this?

Thanks heaps by the way for replying.
 
Format your text box as required (Red etc)


Then enter the following as the control source:

=IIf([Total_Length]>[Capacity],"Warning blah blah","")


Where Total_Lenght and Capacity are the names of the txtboxes containing the relevant info.


HTH

Brad.
 
Thanks again but I'm afraid that this did not work.

In design veiw, the code I typed into the control source just appeared in the text box. In form view it's just blank.

I got no idea why....
 
Geez BakerBoy, you are making me look bad. ;)

The box should be blank unless the total length IS greater than capacity.

**
Just noticed that your Length / Capacity are list boxes. You will need to allow for the column number if the values are not in the first column (hidden bound columns etc).

Remember that numbering starts from Column(0) (First column).

We will have a win yet.

Brad.
 
Followup:

BakerBoy emailed me the db directly.

Result:

The form was using a single line listbox (appearing as a text box) for comparison of Length v capacity. However as nothing was selected in the listbox, it is not possible to compare values (Well it is but they are both NULL).

Changed Length v Capacity to text boxes and all A-OK

Brad
 

Users who are viewing this thread

Back
Top Bottom