Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Controlling Change event when loading a form

I created an Excel Form 2000 which triggers when user double-clicks on a row,
loading information into the form. In the form there is a disabled SAVE
button that would be enabled when ever a CHANGE is detected.

The problem:
The CHANGE event gets triggered even while loading form, therefore SAVE
button gets enabled, even though no change has been done yet.

I am currently initializing a variable: LOADING_Flag=true when loading, then
controlling the flag as Initialize process is completed. It works but I was
wondering how others are addressing this issue.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,355
Default Controlling Change event when loading a form

You may want to post your form code.

Barb Reinhardt




"Gussie" wrote:

I created an Excel Form 2000 which triggers when user double-clicks on a row,
loading information into the form. In the form there is a disabled SAVE
button that would be enabled when ever a CHANGE is detected.

The problem:
The CHANGE event gets triggered even while loading form, therefore SAVE
button gets enabled, even though no change has been done yet.

I am currently initializing a variable: LOADING_Flag=true when loading, then
controlling the flag as Initialize process is completed. It works but I was
wondering how others are addressing this issue.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Controlling Change event when loading a form

Surething. Form gets loaded from the Worksheet_BeforeDoubleClick event:


Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As
Boolean)

..
code
..
..

frmRouting.Show 'Form gets loaded

bLoadingForm = True 'Loading information
frmRouting.txtRoutingID = Activesheet.cells(Target.Row, 1)
frmRouting.txtOrganizationE = Activesheet.cells(Target.Row, 2)
frmRouting.txtOrganizationF = Activesheet.cells(Target.Row, 3)
frmRouting.strLevel = Activesheet.cells(Target.Row, 4)
bLoadingForm = False 'Loading information already completed
..
..
code
..
..
End Sub

The form get loaded prior to loading information and of course all fields
are blank. Then I initialize each field with information from the worksheet,
which hasn't been changed, but it triggers the xxxxxx_Change() for each of
the text fields.

Using that bLoadingForm flag works but I am just curious as how others have
resolve this issue.

Thank you for replying Barb....


"Barb Reinhardt" wrote:

You may want to post your form code.

Barb Reinhardt




"Gussie" wrote:

I created an Excel Form 2000 which triggers when user double-clicks on a row,
loading information into the form. In the form there is a disabled SAVE
button that would be enabled when ever a CHANGE is detected.

The problem:
The CHANGE event gets triggered even while loading form, therefore SAVE
button gets enabled, even though no change has been done yet.

I am currently initializing a variable: LOADING_Flag=true when loading, then
controlling the flag as Initialize process is completed. It works but I was
wondering how others are addressing this issue.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 40
Default Controlling Change event when loading a form

Hi!

I think that you have to add the above line after the settings of the
textboxes:

frmRouting.cmdSave.Enabled = false

I think it works.

I suggest to use the "AfterUpdate" event of the textbox to enable the button.

John

Ο χρήστης "Gussie" *γγραψε:

Surething. Form gets loaded from the Worksheet_BeforeDoubleClick event:


Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As
Boolean)

.
code
.
.

frmRouting.Show 'Form gets loaded

bLoadingForm = True 'Loading information
frmRouting.txtRoutingID = Activesheet.cells(Target.Row, 1)
frmRouting.txtOrganizationE = Activesheet.cells(Target.Row, 2)
frmRouting.txtOrganizationF = Activesheet.cells(Target.Row, 3)
frmRouting.strLevel = Activesheet.cells(Target.Row, 4)
bLoadingForm = False 'Loading information already completed
.
.
code
.
.
End Sub

The form get loaded prior to loading information and of course all fields
are blank. Then I initialize each field with information from the worksheet,
which hasn't been changed, but it triggers the xxxxxx_Change() for each of
the text fields.

Using that bLoadingForm flag works but I am just curious as how others have
resolve this issue.

Thank you for replying Barb....


"Barb Reinhardt" wrote:

You may want to post your form code.

Barb Reinhardt




"Gussie" wrote:

I created an Excel Form 2000 which triggers when user double-clicks on a row,
loading information into the form. In the form there is a disabled SAVE
button that would be enabled when ever a CHANGE is detected.

The problem:
The CHANGE event gets triggered even while loading form, therefore SAVE
button gets enabled, even though no change has been done yet.

I am currently initializing a variable: LOADING_Flag=true when loading, then
controlling the flag as Initialize process is completed. It works but I was
wondering how others are addressing this issue.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Controlling Change event when loading a form

I have tried both ways with same results. I am going to stick with what I am
doing it, it seems to work. I did some research and downloaded some samples
but in all of them the SAVE button is enabled when form is loaded.

As soon as text box is initialized; events are triggered.

"John_John" wrote:

Hi!

I think that you have to add the above line after the settings of the
textboxes:

frmRouting.cmdSave.Enabled = false

I think it works.

I suggest to use the "AfterUpdate" event of the textbox to enable the button.

John

Ο χρήστης "Gussie" *γγραψε:

Surething. Form gets loaded from the Worksheet_BeforeDoubleClick event:


Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As
Boolean)

.
code
.
.

frmRouting.Show 'Form gets loaded

bLoadingForm = True 'Loading information
frmRouting.txtRoutingID = Activesheet.cells(Target.Row, 1)
frmRouting.txtOrganizationE = Activesheet.cells(Target.Row, 2)
frmRouting.txtOrganizationF = Activesheet.cells(Target.Row, 3)
frmRouting.strLevel = Activesheet.cells(Target.Row, 4)
bLoadingForm = False 'Loading information already completed
.
.
code
.
.
End Sub

The form get loaded prior to loading information and of course all fields
are blank. Then I initialize each field with information from the worksheet,
which hasn't been changed, but it triggers the xxxxxx_Change() for each of
the text fields.

Using that bLoadingForm flag works but I am just curious as how others have
resolve this issue.

Thank you for replying Barb....


"Barb Reinhardt" wrote:

You may want to post your form code.

Barb Reinhardt




"Gussie" wrote:

I created an Excel Form 2000 which triggers when user double-clicks on a row,
loading information into the form. In the form there is a disabled SAVE
button that would be enabled when ever a CHANGE is detected.

The problem:
The CHANGE event gets triggered even while loading form, therefore SAVE
button gets enabled, even though no change has been done yet.

I am currently initializing a variable: LOADING_Flag=true when loading, then
controlling the flag as Initialize process is completed. It works but I was
wondering how others are addressing this issue.

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
Date field in user form & Loading a user form on opening workbook Balan Excel Programming 1 May 24th 08 03:40 PM
Controlling an Option Group in a User Form SaeOngJeeMa Excel Discussion (Misc queries) 0 November 29th 06 08:17 AM
Transfer data to form from Excel range upon loading of form. Rob Crawford Excel Programming 2 October 24th 05 03:59 PM
Controlling Text Loading Nigel[_8_] Excel Programming 13 February 13th 04 09:01 AM
Disable Change Event in Form No Name Excel Programming 5 October 31st 03 08:23 PM


All times are GMT +1. The time now is 02:59 PM.

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"