D
dchendrickson
I am using Access2002 / XP Pro.
I am working with a main form and a popup form. When the
OK button on the main form is clicked, the cmdOK_Click()
event procedure determines if the popup needs to be
opened based on certain criteria. The popup lets the user
choose between Overwriting the current record with new
information, or ADDing a new record based on the
information.
The popup contains a label (for messages) and two
buttons. The form has Allow Edits=true, popup=true,
modal=true, borderstyle=dialog. The OnClick events for
each button set the value of a global boolean and then
close the popup. The global boolean is used to determine
the choice of the user.
Based on another posting here, I am opening the popup with
Dim frm as Form
Set frm = ....
....
DoCmd.OpenForm frm.Name, acNormal, , , , acDialog
I am using the acDialog setting to stop the program flow
of the main code (cmdOK_Click) until the user clicks a
button. But I am having some problems.
I need to open the popup and change the caption of its
label. But if I set a variable equal to the label control
of the unopened form, assign my new label string to
label.caption, then execute the ...OpenForm method, the
label does not show the new string. If I put the command
to update the label after the OpenForm method, the
program is paused for input and never gets there.
Next problem: There is no close button on the popup. The
last line of the code for each button on the form is:
DoCmd.Close acForm, "popOverWriteAdd", acSaveNo
The theory is to click the button of choice, the code
sets the value of the boolean and then closes the form.
But the form won't close. Do I need to change the focus
back to the main form before I can close the popup? Or is
there another issue?
Ideally, I would like to have the popup behave exactly
like the msgbox function, but be able to put my own
Caption on the buttons. Class Modules and functions at
that level are above my abilities at this time. Is there
something 'off the shelf' that I could use?
I know this has several different issues wrapped into one
posting, but thanks for your help.
-dc
I am working with a main form and a popup form. When the
OK button on the main form is clicked, the cmdOK_Click()
event procedure determines if the popup needs to be
opened based on certain criteria. The popup lets the user
choose between Overwriting the current record with new
information, or ADDing a new record based on the
information.
The popup contains a label (for messages) and two
buttons. The form has Allow Edits=true, popup=true,
modal=true, borderstyle=dialog. The OnClick events for
each button set the value of a global boolean and then
close the popup. The global boolean is used to determine
the choice of the user.
Based on another posting here, I am opening the popup with
Dim frm as Form
Set frm = ....
....
DoCmd.OpenForm frm.Name, acNormal, , , , acDialog
I am using the acDialog setting to stop the program flow
of the main code (cmdOK_Click) until the user clicks a
button. But I am having some problems.
I need to open the popup and change the caption of its
label. But if I set a variable equal to the label control
of the unopened form, assign my new label string to
label.caption, then execute the ...OpenForm method, the
label does not show the new string. If I put the command
to update the label after the OpenForm method, the
program is paused for input and never gets there.
Next problem: There is no close button on the popup. The
last line of the code for each button on the form is:
DoCmd.Close acForm, "popOverWriteAdd", acSaveNo
The theory is to click the button of choice, the code
sets the value of the boolean and then closes the form.
But the form won't close. Do I need to change the focus
back to the main form before I can close the popup? Or is
there another issue?
Ideally, I would like to have the popup behave exactly
like the msgbox function, but be able to put my own
Caption on the buttons. Class Modules and functions at
that level are above my abilities at this time. Is there
something 'off the shelf' that I could use?
I know this has several different issues wrapped into one
posting, but thanks for your help.
-dc