Form will not refresh without an unneeded msgbox

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am closing a form and transferring the info to a spreadsheet to allow users to work with it. I then give the option of reopening the form and at that time reload the info from the spreadsheet into the form.

Problem is the information is not displayed correctly (caluclations are not run) on the form unless I run a msgbox.
I expected that a Userform.repaint would do the trick - but no such luck.

I do not understand why simply displaying a msgbox would fix the problem and I would like to eliminate it as it is just an unneeded click.

Anyone have any clues?
TerryK
 
Hi TerryK,

May I ask which version of XL are you using and let us have the
code(not need whole code, but the issue may has been hidden in there.)
 
The suggestion from Shah Shailesh did not work (seems like it should) so here is the code from the spreadsheet module that reloads the userform (Inputform)

Private Sub CommandButtonEditQuote_Click()
Load FormInput
FormInput.UserForm_Activate
FormInput.ReloadQuotetoInputForm
'the sub above reloads the info to the form and runs the calculations
FormInput.Show (0)
'if I do not include the msgbox below - the form view is incorrect-calculations are not run

Response = MsgBox("Quote has been successfully reloaded for editing", vbOK)

End Sub

Thanks to both of you for your suggestions.
TerryK
 
Terry,

Seems you're going a long way round to do what you want.

Private Sub CommandButtonEditQuote_Click()
FormInput.Show
End Sub


In FormInput:
Private Sub UserForm_Activate()
FormInput.ReloadQuotetoInputForm
End Sub

HTH
Henry

TerryK said:
The suggestion from Shah Shailesh did not work (seems like it should) so
here is the code from the spreadsheet module that reloads the userform
(Inputform)
Private Sub CommandButtonEditQuote_Click()
Load FormInput
FormInput.UserForm_Activate
FormInput.ReloadQuotetoInputForm
'the sub above reloads the info to the form and runs the calculations
FormInput.Show (0)
'if I do not include the msgbox below - the form view is
incorrect-calculations are not run
 
Henry,
BINGO! Worked perfectly. That was so simple and efficient I would have never found it on my own.

Thanks
TerryK
 
Back
Top