Open MsgBox dependant on Yes/No

G

Gary Brett

Hi.
This sound's very simple and probably is but I just cannot figure it
out and wonder if anyone can help. As it says above, I have a checkbox
in a table which is either checked or left unchecked dependant on the
accompanying record. On a form a user selects a record and if that
records checkbox is ticked I want a msgbox to appear. I have attempted
to create a Macro that looks at the field on update, but nothing
happens:
CONDITION - [Software]![CDROM]=-1
ACTION - MsgBox
Can anyone shed any light on this please...
Thanx
G
 
J

Jeff Boyce

Gary

If I were trying to do this, I would add code to the OnCurrent event. That
way, whenever a new record is viewed, the code would check the checkbox and
react.
 
G

Gary Brett

Jeff Boyce said:
Gary

If I were trying to do this, I would add code to the OnCurrent event. That
way, whenever a new record is viewed, the code would check the checkbox and
react.

Hi Jeff,
It does not seem to matter where I place the macro, it will not
produce a popup megbox. I have tried OnCurrent event & many other
events but I must be doing something worng because it will not work...

Any other advice appreciated & thanx for your time
G
 
J

Jeff Boyce

Gary

I was suggesting you use code, not a macro. I don't know if that will make
a difference...
 
G

Gary Brett

Jeff Boyce said:
Gary

I was suggesting you use code, not a macro. I don't know if that will make
a difference...

Hmmmm,
I guess it may if I knew any VBA ! Hsave you any suggestions on how to acheive this?
Cheers
G
 
J

Jeff Boyce

Gary

If you haven't worked in VBA, it might be a little tough to present this in
a context that makes sense. Plus, the commands have variations between what
you see when you use a macro and what you code when you write code.

The following "aircode" (untested - actual syntax may vary) gives a flavor
of what you'd put into an Event Procedure for the OnCurrent event:

If Me!chkMyCheckBox = True Then
Msgbox "This is the popup message", vbOKOnly, "MessageBox Title"
Else
'rem: did you want something else to happen if unchecked?
End If
 
G

Gary Brett

Jeff Boyce said:
Gary

If you haven't worked in VBA, it might be a little tough to present this in
a context that makes sense. Plus, the commands have variations between what
you see when you use a macro and what you code when you write code.

The following "aircode" (untested - actual syntax may vary) gives a flavor
of what you'd put into an Event Procedure for the OnCurrent event:

If Me!chkMyCheckBox = True Then
Msgbox "This is the popup message", vbOKOnly, "MessageBox Title"
Else
'rem: did you want something else to happen if unchecked?
End If


Nice one Jeff.
That works great if I actually check the checkbox (update I guess),
but that checkbox is a field that has been checked previously.
Basically we have a DB of brokers. If a broker is acceptable for us to
use, we check the checkbox next to his name in another broker form.
Now in yet another form when the user selects the broker from a list
it automatically brings thru the checkbox setting, and if its is
checked pops up the msgbox

Hope this clarifys a bit. I have no oncurrent in the checkbox field
properties..

Thanx for your time
G
 

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