code keeps running after open form

XaloRichie

Registered User.
Local time
Today, 17:51
Joined
Jul 2, 2003
Messages
70
I have a form which has 3 buttons.
onclick each button sets a variable strDur to a respective vale
1,2 or 3.

My code calls the form using Docmd.open form
The form Opens But before I can click a button the code continues
to the next step.

I want to wait until the button has been selected then continue with main code.

What should I do Please.
 
Put the rest of the code in a function and call that function when the user clicks a button.
 
Hi,
Give at the before last argument of DoCmd.OpenForm 'acDialog', and your code will stop running until you closed that form, ie:
DoCmd.OpenForm "FormName", , , , , acDialog

Is that what you mean?

Else, try to explain more exactly and, if possible, post your code
 
Last edited:
Have Tried, but wont give up!

I have tried the acDialog and set form property to modal border style to modal. but NO. The form is called from withing a Public Function. If that is relevant?

Even as modal the form opens but I cant see my buttons it is like a blank form with record selectors? Yet if I open it from the DB window it has 3 buttons as I want?
Basically I want the user to select one of 3 options Assign that value (1,2 or 3) to a variable and then the code to continue but. The form opens and doesn't wait for user to click and theres no button showing if it did.

Code

AskDuration:

'ask AM or PM or Full Day
DoCmd.OpenForm "Durat", acDialog
StrdateEnd = Strdatestart

GoTo checkavail

The code runs straight into checkavail: What am I doing wrong?
 
I've got a form running in this style with:
Pop-Up = Yes
Modal = Yes
BorderStyle = Dialog (doesn't matter I think, but it is)

And it's working fine.
 
Success

It Was My commas not enough before acDialog !!!!!!!


Thanks chaps
 

Users who are viewing this thread

Back
Top Bottom