How do I ...

aziz rasul

Active member
Local time
Today, 20:19
Joined
Jun 26, 2000
Messages
1,935
I have a main form (frmMain) which opens up another form (frmSecondary) via a command button.

Depending upon which of 2 buttons is pressed on frmSecondary, the code in frmMain either exits the event procedure or continues. How can I halt the code in frmMain until the user presses one of the 2 command buttons on frmSecondary?

At the moment, my code in frmMain just carries on.
 
It sounds like i would have the code split up into seperate functions.

i.e. all the code after the form open command move to another Sub and then on the button on subform call that Sub.
 
I understand what you're saying. If nothing else works effectively, I'll have to do that.
 
It's frowned upon for various reasons but if you are determind to find a way like this then you could look into using goto statements. I have never really used them so dunno if it would be suitable but it might be worth a look.
 
One solution was to open frmSecondary in acDialog mode. However one of the things I had to do was to change the captions of 2 labels, which I cannot now do. Hence I'm changing the labels to text boxes to get round it and prevent the user from changing the contents of the text boxes.

I have a label on frmMain. When any of the 2 buttons are pressed on frmSecondary, the caption of this label changes and hence I know what action the user has chosen.
 

Users who are viewing this thread

Back
Top Bottom