Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 28
Default Disabled Enabled

I have a problem with Enabled=True

I have 18 textboxes. All prefilled with suggested values.

Textbox1 opens first. All other textboxes are now Enabled=False so user
can not use mouse and jump randomly. User can enter another value in
textbox1 and press tab or accept suggested value by just pressing tab.

When user tries to leave textbox1 I trap it with the Textbox1.Exit
control (and I also use "before update" to reset to if new value not
allowed) and compare the new value to other values. If it is accepted by
my compare I allow the user to leave Textbox1 and I place the user in
Textbox2.

But to do this I have to set Enabled=True for Textbox2. So if the input
in Textbox1 is okay I have to set Enabled=True for Textbox2. This is the
bit that isn't working. When the code runs that sets Enabled = True for
Textbox2 it then thinks the user has left textbox2 and it runs the Exit
check for Textbox2 and moves on to Textbox3 and so on. The entire
proceedure runs through to Textbox18

There are probably other ways to do this, but before I change all the
code and have a rethink I wonder if anyone knows a way to stop the use
of Enabled from triggering the Exit feature.

Garry Jones
Sweden
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 535
Default Disabled Enabled

Hi,

I would advise to include some code to temporarily disable
the events from firing.

- At the top of the form's module (in what is known as the
declaration section) type:

Dim bDisableEvents as Boolean

Now in each event sub that needs it:

Private sub WhateverControl_Click()
If bDisableEvents Then Exit sub
bDisableEvents=True
'Your code
bDisableEvents=False
End Sub

Regards,

Jan Karel Pieterse
Excel TA/MVP

-----Original Message-----
I have a problem with Enabled=True

I have 18 textboxes. All prefilled with suggested values.

Textbox1 opens first. All other textboxes are now

Enabled=False so user
can not use mouse and jump randomly. User can enter

another value in
textbox1 and press tab or accept suggested value by just

pressing tab.

When user tries to leave textbox1 I trap it with the

Textbox1.Exit
control (and I also use "before update" to reset to if

new value not
allowed) and compare the new value to other values. If it

is accepted by
my compare I allow the user to leave Textbox1 and I place

the user in
Textbox2.

But to do this I have to set Enabled=True for Textbox2.

So if the input
in Textbox1 is okay I have to set Enabled=True for

Textbox2. This is the
bit that isn't working. When the code runs that sets

Enabled = True for
Textbox2 it then thinks the user has left textbox2 and it

runs the Exit
check for Textbox2 and moves on to Textbox3 and so on.

The entire
proceedure runs through to Textbox18

There are probably other ways to do this, but before I

change all the
code and have a rethink I wonder if anyone knows a way to

stop the use
of Enabled from triggering the Exit feature.

Garry Jones
Sweden
.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Maccro Enabled message akkrug New Users to Excel 2 June 24th 09 01:48 PM
Macro Enabled workbooks Polaris Excel Discussion (Misc queries) 2 August 10th 08 04:03 AM
AutoFilter is not enabled paula Excel Discussion (Misc queries) 1 December 19th 07 02:33 PM
Select All enabled Trilix Setting up and Configuration of Excel 2 January 12th 07 06:23 PM
ADO connection not always enabled Vaughan B Excel Programming 1 July 10th 03 01:09 AM


All times are GMT +1. The time now is 01:20 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"