Can I send a message from one session to another session?

P

paul.schrum

I have two databases: One contains only tables (tables.mdb) and the
other all queries, forms, modules (interface.mdb). When a user opens
interface.mdb he can't do anything unless he links to the tables in a
tables database or creates one (which is automatically opened/linked.)

I need to be able to send a message from one session of interface.mdb
to another session of it. Let me clarify:

The databases are for managing tasks. Mr. Manager has one session of
interface.mdb open on his machine. Simultaneously Mr. Employee has
another session of interface.mdb open. Both users are linked to the
same tables.mdb.

Mr. Employee is looking at form My Pending Tasks, which has, say, 5
tasks showing. At the same time, Mr. Manager assigns a task to Mr.
Employee and he now has 6 tasks. Because of this there is a new task
in tables.mdb for Mr. Employee to work on. Unfortunately, he will not
see this new task until he does something to force a query update,
such as open the form again. I want to find a way to make the form
update its bound query as soon as the new row gets added by Mr.
Manager. How can I do this?

I expect that I must find a way to make Mr. Manager's session of
interface.mdb send a message to Mr. Employee's session of
interface.mdb suggesting that Mr. Employee's session refresh its
query.

Now to the questions. Is this the recommended approach? If yes, how
do I make this happen? If no, what approach should I use and how do I
do it?

Thanks in advance to all who respond.

- Paul Schrum
 
P

paul.schrum

I forgot to say:

I am developing for Access 2003 (but using 2007 in 2003-2003 mode to
do most of the development).

- Paul
 
G

Guest

How about using an OnTimer event in your employee form? Set the timer to
say, 30000 (30 seconds) and the OnTimer as
Me.Requery

This will requery the table to make the form reflect the most current data.

Other questions to consider:
What kind of form is this? When you requery it will send you back to the
first record. Will that matter?

How many records are there on a given day? Is it only a few, <5 or so? or
more, >100?

PJ
 
P

paul.schrum

How about using an OnTimer event in your employee form? Set the timer to
say, 30000 (30 seconds) and the OnTimer as
Me.Requery
This is my backup plan. However, if it is possible to accomplish what
I want to accomplish with messaging, I would rather do that.
Other questions to consider:
What kind of form is this?
It is a Columnar form. The user will navigate the dynaset by clicking
on rows in a list box.
When you requery it will send you back to the
first record. Will that matter?
The form itself will not requery. The record-navigation list box
will. I also plan to have a way to watch the task count. When the
count goes up, there will be a signal -- perhaps modal OK form saying
"you've got task."

Because of this, I don't thing the form will jump to a different
record.
How many records are there on a given day? Is it only a few, <5 or so? or
more, >100?
It will be < 25, with 0-5 happening most days.

- Paul
 
G

Guest

I think see.

Try this. Create a form that has the OnTimer event and set it to open on
start up as a hidden form. Have a DCount function that counts the number of
records you are interested in. If the form executes the count function every
minute or so (maybe longer) you should be able to compare the number before
it runs to the number after it runs. If the new number is greater than the
old number, the modal form opens.

I am just thinking out-loud. If that works I can post the code for you.

PJ
 
P

paul.schrum

PJ,

I guess I did not clarify in my OP that firing a query on a timer was
always my backup plan and I have implemented a solution like this
before.

I want to know if there is a way to do messaging between two sessions
which which are both linked to the same data-mdb file. If there is no
way to do this, and no way other than queries on timers to simulate
it, knowing this is good enough.

I am at lunch and therefore in a bit of a hurry-up-and-type mindset.
When I am in this state I sometimes come across as short in emails and
usenet. If I have fallen into that mistake again, I apologize. I'm
just looking for a way to do code-to-code messaging between different
user-sessions.

- Paul
 

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