Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have a form with a textbox on it and "Go" Command button
What I am trying to accomplish is when I click the Go button on my form I would like like vba to check to see if MyTextBox has been changed at all, ie.. new data has been typed in to Mytextbox or even if it has just been clicked on. The problem I am having is my program is supposed to set "TxtBoxModified" variable to True if the textbox on my form has been edited or changed at all. However when I load the form and just click on the "Go" Command button VBA sets the variable "TxtBoxModified" to true even if I didn't click or change anything with the textbox on my form. Why is this not working ? Any thoughts would be appreciated my form code is as follows _____________________________ Dim TxtBoxModified as Boolean Private Sub MyTxtBox_Change() TxtBoxModified = True End Sub Private Sub cmdGoButtons_Click() MsgBox (TextBoxModified) End Sub ----------------------------------------------- Dan Thompson |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Is the textbox always blank when the form is shown.
If so, why not just check if it is still blank or if it has a default value, if it still has the default value. -- Regards, Tom Ogilvy "Dan Thompson" wrote in message ... I have a form with a textbox on it and "Go" Command button What I am trying to accomplish is when I click the Go button on my form I would like like vba to check to see if MyTextBox has been changed at all, ie.. new data has been typed in to Mytextbox or even if it has just been clicked on. The problem I am having is my program is supposed to set "TxtBoxModified" variable to True if the textbox on my form has been edited or changed at all. However when I load the form and just click on the "Go" Command button VBA sets the variable "TxtBoxModified" to true even if I didn't click or change anything with the textbox on my form. Why is this not working ? Any thoughts would be appreciated my form code is as follows _____________________________ Dim TxtBoxModified as Boolean Private Sub MyTxtBox_Change() TxtBoxModified = True End Sub Private Sub cmdGoButtons_Click() MsgBox (TextBoxModified) End Sub ----------------------------------------------- Dan Thompson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
FINDING AN EXACT MATCH ON 2 DIFFERENT SHEETS THEN EXECUTING A FORM | Excel Worksheet Functions | |||
Can a form made in Excel 2002 be converted into a fillable form? | Excel Discussion (Misc queries) | |||
Code not executing | Excel Programming | |||
VBA code stops executing | Excel Programming | |||
Code Changes Not Executing | Excel Programming |