check box on form to prevent it from appearing again

Mike Hughes

Registered User.
Local time
Today, 13:07
Joined
Mar 23, 2002
Messages
493
I have a small form that appears when the user makes a change to a field in another form. It is just a warning message and it goes away after 5 sec. I would like to add a check box at the bottom of the small form which would allow the user to turn this small warning form off. When the field is changedon the main form, this small box pops up.
I have the check box and don't know where to go from here.

Can someone tell me the code and where I put it to allow the user to turn it off - after it has driven them nuts for a few weeks?

Thanks
 
one way would be on the after update of your field

if me![checkboxname]=true then
' do nothing
else
docmd.open your form
end if
 
Put in the OnOpen event of the popup form

if me![checkboxname]=true then
docmd.close
end if

That way the form will open but will close again before it becomes visible.

The checkbox would be on the popup form.
The only problem I foresee with this is truning it back on again without going into the table that holds the value and alrering it there.
Dave
 
The question is how permanently do you want to turn this pop up off.
1. For this record.
2. For this session (ie until the db is closed and reopened).
3. Permanently for all future sessions.

The solution will vary depending on the answer to the question.
1. will require a data field to be added to the record.
2. will require a global variable or hidden form.
3. will require a new table to hold this setting.
 
Oldsoftboss,

I'm going to try your idea first. Where do I place your code:

if me![Check5]=true then
docmd.close
end if

Here is what I now have on the OnOpen Event of the popup form.
where do I place your code?

Option Compare Database
Option Explicit

Private Sub Form_Open(Cancel As Integer)
TimerInterval = 5000
End Sub


Private Sub Form_Timer()
DoCmd.Close acForm, "fMessage"
End Sub


Thanks:(
 
You shouldn't need to set the timer in the OnOpen event, set it in the form properties (at the bottom)

Depending on where your checkbox is, put one of the following where the Interval timer bit is

If the check box is on the popup form...

Private Sub Form_Open(Cancel As Integer)

if me.checkboxname = true then
docmd.close
end if

End Sub

Or if the checkbox is on your main form....

Private Sub Form_Open(Cancel As Integer)

if Forms!MainFormName.checkboxname = true then
docmd.close
end if

End Sub

Both OnOpen codes are run on the popup forms onopen event.

HTH

Dave
 

Users who are viewing this thread

Back
Top Bottom