Initiate VB code remotely

E

Eirik

Hello!

Today i am using a timer function to check a value in an text box at a form.

I ex:
If me.tbx_1 = "yes" then
'do something useful
end if

The tbx_1 field is bound to a table which i can update remotely.

This timer function runs continuesly trough the day on all computers. Every
time the code runs, ex every 10000ms, it hangs the form for a short period of
time.

My question is, is there any other way to make Access initiate code from å
remote computer?
 
S

Stefan Hoffmann

hi,
Today i am using a timer function to check a value in an text box at a form.
Why don't you use the After Update event of that control?
This timer function runs continuesly trough the day on all computers. Every
time the code runs, ex every 10000ms, it hangs the form for a short period of
time.
Obviously the "'do something useful" part needs CPU cycles while it's
executed.
My question is, is there any other way to make Access initiate code from å
remote computer?
Basically, yes. But this strongly depends on your actual problem you're
trying to solve.


mfG
--> stefan <--
 
E

Eirik

If i use the afterupdate event it is the user at computer 1 that needs to
make a change to the record.

My situasjon is that computer1 has a field1 bound to table1. On computer2 i
make a correction to the value at field1 in tabel1 and it shows the new value
on computer1's form.

It is not 'do something usefull' which uses CPU cycles. It is the timer
event which is continuesly running in the background to check the IF
statement.


Basically i would like to initiate VB code at Computer1 from Computer2. The
code could be something like docmd.quit or docmd.openform "new message" or
things like that. If i use the Timer event to check for a value in the table
or form it uses cpu cycles. I want to find another way to initiate code
 
E

Eirik

Here is an example

Private sub form_timer()
dim rst as new adodb.recordset
with rst
.open "SELECT * from [table1]",currentproject.connection,
adopenforwardonly, adlockreadonly

If !field1 = "somevalue" then
'do something useful
end if
.close
end with
set rst = nothing

end sub
 

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