Creating an expression or macro to open a form

S

Sharon Walls

Hello,
My question is...
I am trying to write a code that will open a form or another table depending
upon whether or not a certain number is entered into a field.

For example,
IIf [total score] >=16, form! [age]
Or this may be easier...If the total score is greater than 16 I want it to
pop up another question; however, if the score is less than 16 I want it to
give the result "release".

Any insight?
I apologize for all for may be simple questions. This is one of my first
databases that is more complex.

Thanks in advance.
 
D

Damian S

Hi Sharon,

If by popup a question you mean a message box, you could do something like
this in the after update event of your control:

if me.TOTALSCOREFIELD > 16 then
msgbox "The score is over 16"
else
msgbox "The score is under 16"
end if

To open a form, simply use the following syntax:

docmd.openform "FORMNAME", acviewnormal

Hope this helps.

Damian.
 

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