pop-up that asks a question

N

natfish

I would like to create pop-ups that respond to options that are chosen. For
example, I have a form with a drop down for yes/no. If the answer is yes I
want to be able give the user as option to chose whether radiation was
completed or not. I know how to connect the main form to a subform and have
the subform pop up, but I don't want the whole subform to pop-up -- only one
option.

Thanks
 
A

Arvin Meyer [MVP]

Try using a message box function with the question read from the subform.
You can build a popup the same way. In the text box of the popup that holds
the option question, use something like the following:

=Forms!FirstFormName!SubformControlName.Form!OptionQuestionTextBoxName
 
D

Daryl S

Natfish -

Will a message box do what you want? Look up msgbox if you only need to ask
yes/no questions. You can set the title, the message, and which buttons
(within those available) are on the dialog box. You can then take the
response to populate your data. This is a sample, but use whatever parts you
need.

If MsgBox("Was the radiation completed?", vbYesNo, "Radiation Status") =
vbYes Then
'do what you want to update database to say radiation was completed
End If
 
D

Daryl S

Yes, you can put it there. Post your code if you need help with the syntax.
Remember that in posting, line breaks are added. The "vbYes Then" should be
at the end of the first line, not on a separate line.
 
D

Daryl S

Natfish -

You must put this into a table (a form doesn't store data).

It sounds like you don't have a table with the fields you need yet. You
must decide if the new information you are gathering should belong in the
table behind your current form or not. Since you didn't explain your
business, I can't help with that decision. If you decide this new
information belongs with the current information, then you can add fields to
your existing table. In that case, you can add the new field to the form.
If you don't want the user to see this new field (as it won't apply in many
cases), then you can keep it invisible. You would then just set the the
value equal to the results of the msgbox, like this (if RadiationCompleted is
the name of the new control for the new field in the table):

Me.RadiationCompleted = MsgBox("Was the radiation completed?", vbYesNo,
"Radiation Status")

If this won't work, then please explain your business model and where you
think the data should be stored.
 
N

natfish

I have created a database for a medical oncologist. I already have a subform
and table with the information in it -- it is called "case summary". I just
wanted to try to make the form user friendly without adding a new field to
the form.
 
J

John W. Vinson

I have created a database for a medical oncologist. I already have a subform
and table with the information in it -- it is called "case summary". I just
wanted to try to make the form user friendly without adding a new field to
the form.

I do hope you're aware of, and in compliance, with the (rather stringent and
demanding) HIPAA patient medical information laws. Many have argued that
Access databases are inherently not secure enough to comply with those laws.
 
D

Daryl S

That means my last posting should work for you, right? Add the field (make
it invisible), and then update it with the results of the msgbox.
 
N

natfish

yes I am aware

Thanks

John W. Vinson said:
I do hope you're aware of, and in compliance, with the (rather stringent and
demanding) HIPAA patient medical information laws. Many have argued that
Access databases are inherently not secure enough to comply with those laws.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top