How to load userforms in excel (vb)

  • Thread starter Thread starter zisko3
  • Start date Start date
Z

zisko3

10

Hi all,

I am Zisko-Kid and I have 4 userforms in Excel where user's enter dat
which would then be stored in an excel spreadsheet. It was fine to th
point where the 4th form has a command button to allow user to ente
another sale which would bring them back to the first form and thi
should loop through each form til the user has entered enough sales t
click on Exit program. Its not allowing this and gives me this erro
message:

Run-time error '402'

Must close or hide topmost modal form first.

I've tried in the command button (cmdnew)
unload salesleadform
load salesleadform
salesleadform.show

I am open to any suggestions

thank you kindl
 
Normally you would have something like this

'In a module
Sub Control
frm1.show
'handle the data returned
unload frm1
frm2.show
'handle the data returned
Unload frm2
End Sub

'in frm1 code, and frm2 code, etc
cmdOK_Click
me.hide
End Sub

But it sounds like you would be much better off using a multipage control on
a single user form and moving from page to page as the user enters data.

Robin Hammond
www.enhanceddatasystems.com
 
Back
Top