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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Halting code while a form is completed????? 1

Status
Not open for further replies.

Taff07

MIS
Jul 18, 2001
160
GB

Does anyone know if it is possible to pause VBA code while a User completes a form?? or does anyone know a way to use a combo box on a VBA control?

The situation I`m in is that when a user chooses an option form the main menu I need a prompt/form to make them choose their name from a list before continuing to the option they selected. I need this to occur for a number of different menuy options so am after a way to avoid duplicating my coding without a long Select Case statement(or is this the best way?).

The main complication with this is that I have to have the User identifier at this point because users will be sharing machines throughout the day and have to switch between each other.

Any help will be greatly appreciated.

Cheers

Ian
 
WWhat is going to stop any user picking any name they wish to? What would force a new user to say they are a new user, and not just carry on with the identity of the previous user?

If you put a combo box onto the main menu form then the user can identify themselves before they select anything. But as I said, I don't see why the user would bother.
 
If you really must...

Create a small form with the combo box for selecting the UserName. In the VBA code just before you need to capture the UserName open this form in Dialog mode. Make sure you include something to capture the fact that the user tried to close the form without selecting a name. Finally, capture their selection into a hidden textbox or global variable and use it where you need.

=======================================
People think it must be fun to be a super genius, but they don't realize how hard it is to put up with all the idiots in the world. (Calvin from Calvin And Hobbs)

Robert L. Johnson III
CCNA, CCDA, MCSA, CNA, Net+, A+
w: rljohnso@stewart.com
h: wildmage@tampabay.rr.com
 


The database is an existing logging style database where a work order is stored and any actions made on that order are logged against it.

The team has now decided that they want to know who has done which bits of work for both reference to the order and individual productivity stats. Hence it will be in their own interest to ensure their name is logged against an action.

Thanks very much for the help. Dialog mode is just what I needed.
Cheers

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top