robinsdale
Programmer
Hi,
I have an Excel spreadsheet that I've kludged into a database - Excel is the only tool available to me at the moment where I work. For data entry I use a form with text controls. The control source for these controls is not set to anything. Data entered into these controls is saved to a row on a specific sheet in a sub - SaveThisEntry() - with code like:
where the global variable c_row (row) value is established prior to calling the sub.
The user can enter new data using this form, or edit previously entered data. A sub-form with a popup with all records allows selection of a particular record to edit. Once the row number has been established of the record to edit, data from that record is pulled into the form in a sub - ScatterInfo() - with code like:
All this works fine. I found that displaying the data in the form once the user was finished with it tended to confuse the user, so I wrote a sub - ClearAllFields() - to clear the controls of data with code like:
and this is where I ran into a problem. I had ClearAllFields() run in the form's Activate() method, which did as it was paid to do. The ScatterInfo() procedure was called but nothing displayed - no data showed up in the controls. I ran it in Debug mode, stepping through the code, and it went to the appropriate row, and actually even displayed the data in the controls appropriately, but only in debug mode - not when running it in normal mode.
Any idea what the problem might be?
Thanks in advance...
Robin
I have an Excel spreadsheet that I've kludged into a database - Excel is the only tool available to me at the moment where I work. For data entry I use a form with text controls. The control source for these controls is not set to anything. Data entered into these controls is saved to a row on a specific sheet in a sub - SaveThisEntry() - with code like:
Code:
Range("E" & c_Row).Value = .TxtURNumber.Value
The user can enter new data using this form, or edit previously entered data. A sub-form with a popup with all records allows selection of a particular record to edit. Once the row number has been established of the record to edit, data from that record is pulled into the form in a sub - ScatterInfo() - with code like:
Code:
TxtURNumber.Value = Range("E" & c_Row).Value ' UR number
All this works fine. I found that displaying the data in the form once the user was finished with it tended to confuse the user, so I wrote a sub - ClearAllFields() - to clear the controls of data with code like:
Code:
TxtURNumber.Value = ""
Any idea what the problem might be?
Thanks in advance...
Robin