Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Text box value lost
I've created a form that asks users to input a From: date (txtFrom) and a To:
date (txtTo) for setting a print range. The programming works flawlessly for 3 of the 4 users who use it. However, on the one computer (Kurt) where it doesn't work, the form doesn't retain the value of the To: text box after clicking OK. It does retain the value of the From: text box (All users are using Excel 2003). I have an error handler that is triggered if the user doesn't enter a To: date. Part of my code is below. If I step through the code on any of the other 3 user's computer after entering a To: date of 12/15/07, the txtTo.Value = "12/15/07". But if I step through it on Kurt's computer, I get txtTo.Value = "", which then triggers the error handler. I'm befuddled. I checked Tools References in the VB Editor on each computer, and all are the same. Thanks for any ideas you can give me. Public FromDate As Date, ToDate As Date Private Sub cmdOK_Click() frmPrintRange.Hide FromDate = txtFrom.Value 'today's date automatically entered here upon loading of form On Error GoTo ErrorHandler 'if To: date is not entered ToDate = txtTo.Value 'code that sets print range ErrorHandler: MsgBox "No To: date was indicated. Try again.", vbOKOnly, "Error" Unload Me Exit Sub -- Steve C |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Text box value lost
Steve, the problem obviously is not in the code. Check Kurt's worksheet for
a Worksheet_Change code that deletes the date entry or sets the cell value to null. The problem is somewhere in Kurt's system. "Steve C" wrote: I've created a form that asks users to input a From: date (txtFrom) and a To: date (txtTo) for setting a print range. The programming works flawlessly for 3 of the 4 users who use it. However, on the one computer (Kurt) where it doesn't work, the form doesn't retain the value of the To: text box after clicking OK. It does retain the value of the From: text box (All users are using Excel 2003). I have an error handler that is triggered if the user doesn't enter a To: date. Part of my code is below. If I step through the code on any of the other 3 user's computer after entering a To: date of 12/15/07, the txtTo.Value = "12/15/07". But if I step through it on Kurt's computer, I get txtTo.Value = "", which then triggers the error handler. I'm befuddled. I checked Tools References in the VB Editor on each computer, and all are the same. Thanks for any ideas you can give me. Public FromDate As Date, ToDate As Date Private Sub cmdOK_Click() frmPrintRange.Hide FromDate = txtFrom.Value 'today's date automatically entered here upon loading of form On Error GoTo ErrorHandler 'if To: date is not entered ToDate = txtTo.Value 'code that sets print range ErrorHandler: MsgBox "No To: date was indicated. Try again.", vbOKOnly, "Error" Unload Me Exit Sub -- Steve C |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Text box value lost
That's what I was suspecting. I will try your suggestion. Thanks!
-- Steve C "JLGWhiz" wrote: Steve, the problem obviously is not in the code. Check Kurt's worksheet for a Worksheet_Change code that deletes the date entry or sets the cell value to null. The problem is somewhere in Kurt's system. "Steve C" wrote: I've created a form that asks users to input a From: date (txtFrom) and a To: date (txtTo) for setting a print range. The programming works flawlessly for 3 of the 4 users who use it. However, on the one computer (Kurt) where it doesn't work, the form doesn't retain the value of the To: text box after clicking OK. It does retain the value of the From: text box (All users are using Excel 2003). I have an error handler that is triggered if the user doesn't enter a To: date. Part of my code is below. If I step through the code on any of the other 3 user's computer after entering a To: date of 12/15/07, the txtTo.Value = "12/15/07". But if I step through it on Kurt's computer, I get txtTo.Value = "", which then triggers the error handler. I'm befuddled. I checked Tools References in the VB Editor on each computer, and all are the same. Thanks for any ideas you can give me. Public FromDate As Date, ToDate As Date Private Sub cmdOK_Click() frmPrintRange.Hide FromDate = txtFrom.Value 'today's date automatically entered here upon loading of form On Error GoTo ErrorHandler 'if To: date is not entered ToDate = txtTo.Value 'code that sets print range ErrorHandler: MsgBox "No To: date was indicated. Try again.", vbOKOnly, "Error" Unload Me Exit Sub -- Steve C |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
I lost the box on the top of Excel that you can type text in??? | Excel Worksheet Functions | |||
Japanese text lost when save as tab delimited text file | Excel Programming | |||
Text Box lost its leading 0 - need help | Excel Programming | |||
text cells end page how split to next. Text lost! | Excel Discussion (Misc queries) | |||
Text in Excel is lost | Excel Discussion (Misc queries) |