ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How to load userforms in excel (vb) (https://www.excelbanter.com/excel-programming/289394-how-load-userforms-excel-vbulletin.html)

zisko3

How to load userforms in excel (vb)
 
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

--
Message posted from http://www.ExcelForum.com


Robin Hammond[_2_]

How to load userforms in excel (vb)
 
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


"zisko3 " wrote in message
...
10

Hi all,

I am Zisko-Kid and I have 4 userforms in Excel where user's enter data
which would then be stored in an excel spreadsheet. It was fine to the
point where the 4th form has a command button to allow user to enter
another sale which would bring them back to the first form and this
should loop through each form til the user has entered enough sales to
click on Exit program. Its not allowing this and gives me this error
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 kindly


---
Message posted from http://www.ExcelForum.com/





All times are GMT +1. The time now is 10:40 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com