Limit Message Box

S

Scafidel

I have an Access form that I am putting on several computers. At some point
I have a message box appear suggesting that the user look over the input up
to that point. I would like the message to appear, say 10 times and then not
appear anymore, since the user will not need to be reminded anymore.
Without going in and removing it, how can I do this?
 
J

John W. Vinson

I have an Access form that I am putting on several computers. At some point
I have a message box appear suggesting that the user look over the input up
to that point. I would like the message to appear, say 10 times and then not
appear anymore, since the user will not need to be reminded anymore.
Without going in and removing it, how can I do this?


Going to be a bit complicated. You'll probably need to have a Table with one
integer field, which you will increment each time the message box code
executes; you can check it at the start of the code to see how many times it's
run already.
 
S

simis

Scafidel said:
I have an Access form that I am putting on several computers. At some
point
I have a message box appear suggesting that the user look over the input
up
to that point. I would like the message to appear, say 10 times and then
not
appear anymore, since the user will not need to be reminded anymore.
Without going in and removing it, how can I do this?
 
R

Ron2006

Things to consider if you try that approach.

1) If the different installations are sharing a common tables mdb then
if you put that table there the the message will appear x number of
times in total not by user.

2) If you put that table in the user's copy then the next time he/she
gets a new version, the count starts over unless you take the logic
out.

Perhaps instead, have a table either shared or not that contains a
date and when you install it have it appear for x days and then stop.

Still have to address a NEW installation that occurs After those x
days have passed.


Perhaps local table with date that is empty whenever a new version is
obtained and if so then loads todays date in the record and then will
appear up to x days after that. That way new version or new install
would have empty table (empty record or value that says new install
and therefore should start messages.)

So many ways to skin the cat........

Ron
 
S

Scafidel

Your last version seems to fit. For the time being, I am copying the
database with a clean table to each computer, with a reference ID# created by
adding 11000 to primary key for the first computer, 12000 to the next, etc.,
so I could use the install dates, with I suppose, an If then statement. I'm
not sure how to write the code and reference the MsgBox.
Thanks
 
R

Ron2006

Assuming a control table as follows:



MessageControlTable
ID autonumber
CntrlDate Date/time

====================

When the applicatioin is installed on a computer then leave a BLANK/
empty record in the table. The following logic assums that there is a
record in the table. To create the record simply put a date in the
table and then erase the date value from the record.
====================

In the OnOpen or OnLoad event of the first form that is opened or
some button they have to push add code to:

dim hldDate as date
Set Db = CurrentDb()

Set MsgDb = Db.OpenRecordset("MessageControlTable")
with MsgDb
MsgDb .MoveFirst
if isnull(![CntrlDate]) then
MsgDb.edit
MsgDb.Fields("[CntrlDate]") = Date()
MsgDb.Update
hldDate = Date()
else
hldDate = ![CntrlDate]
endif
end with
msgdb.close
set msdb = nothing
set db = nothing

if date() > hldDate + 10 then
msgbox "Be Sure to look over the input up to that point." '
or whatever else you want to say
endif

======================



That is the general idea

Ron
 
Top