Form doesn't stop for user input !!!

sidewinder

New member
Local time
Today, 22:05
Joined
Sep 14, 2010
Messages
3
Hi,

I have a main form with a multi select list box so users can choose their emergency contact.
When the OK button is pressed VBA code uses a FOR EACH loop to go through the selected emergency contacts in the list box, and display a modal popup form with one of the selected emergency contacts so a combobox can be used to select the relationship to that emergency contact. once the user presses OK in that form, the same form may appear again depending on how many emergency contacts were selected in the multi select list box.

PROBLEM.
The form inside the FOR EACH loop never stops to allow user input. It flashes 2,3,4 times depending on how many emergency contact were selected but never allows user input.

So the loop works and the records are saved correctly but with no relationship data!

Any help would be very much appreciated.

Thanks
AK
 
I would suggest looking at going through the list as you are doing and saving the values in a string or in variables. Then after these are saved loop through each one to get the relationship. Hope this makes sense.
 
Thanks, I understand what you mean but sooner or later I will have to do the same i.e. end up calling a form from within a loop and why would it be any different?

Still don't understand why a call to a modal form doesn't stop the code and wait at the form for user input before continuing the code.

Thanks for looking and helping Ken.
Cheers.
 
the modal form cannot be opening correctly. so it just closes, and carries on.

I think that is where to look

put a breakpoint in your app, where the form pops up, and step through from there.
 
I have found the answer, it was (and probably is for lots of people like me!) a concept problem.

The modal form is not a dialog unless I open it as such, and I had not! I just thought modal meant it would stop for input.

This page explained it all.
http://www.members.shaw.ca/AlbertKallal/Dialog/Index.html

Thanks guys, you really make life easier.
Cheers
Abdul
 

Users who are viewing this thread

Back
Top Bottom