Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Values don't display in a form

Status
Not open for further replies.

robinsdale

Programmer
Jun 5, 2001
31
0
0
AU
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:
Code:
Range("E" & c_Row).Value = .TxtURNumber.Value
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:
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 = ""
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
 
Hi Robin,

Try to use at the end of your ScatterInfo() procedure:

Code:
MyForm.Repaint
[\code]

Where "MyForm" is the name of your Form.

Not sure it will fix your problem ... but it might.

Nath
 
Hi Nath,
Just tried your suggestion - it seems to be working! Thanks so much - this problem has had me baffled for days...

Kindest regards,
Robin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top