frames in user forms

VBAmalta89

Board Regular
Joined
Mar 25, 2011
Messages
116
I have 2 frames in a user form which can be activated by means of an option button. One of these frames has a number of text boxes and a data validation function exists to ensure that the total value entered in the text boxes dont exceed 100, are below 100 or are blanks. If any of these occurs then the user is prompted upon clicking the done button and must correct the rror beofre proceeding.

For some reason when the other frame is activated (which doesnt contain any such functions) the program still prompts that values are incorrect, i.e the function still runs even though the frame is meant to be inactive.

Any suggestion as to what the problem may be?
 

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
How are you using the functions to valid the data?
 
Upvote 0
For example under the sub called done_click i have the following:

If (Val(DistanceAir.Value) + Val(DistanceLand.Value) + Val(DistanceSea.Value)) > 100 Then
MsgBox "Maximum of 100% exceeded for distance!"
Exit Sub
End If
 
Upvote 0
So there's no code in the events for the individual texboxes?
 
Upvote 0
I can't see how that code would be getting triggered.

Are you sure it's this code that's being run?

I know it probably is but it wouldn't harm to check - just put a breakpoint (F9) on the sub header.
 
Upvote 0
So when the breakpoint is reached do you go into debug mode?
 
Upvote 0

Forum statistics

Threads
1,224,548
Messages
6,179,445
Members
452,915
Latest member
hannnahheileen

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top