A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Database Design
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Initiate VB code remotely



 
 
Thread Tools Display Modes
  #1  
Old March 25th, 2009, 11:22 AM posted to microsoft.public.access.tablesdbdesign
Eirik
external usenet poster
 
Posts: 7
Default Initiate VB code remotely

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?
  #2  
Old March 25th, 2009, 12:05 PM posted to microsoft.public.access.tablesdbdesign
Stefan Hoffmann
external usenet poster
 
Posts: 991
Default Initiate VB code remotely

hi,

Eirik wrote:
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 --
  #3  
Old March 25th, 2009, 12:47 PM posted to microsoft.public.access.tablesdbdesign
Eirik
external usenet poster
 
Posts: 7
Default Initiate VB code remotely

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

  #4  
Old March 25th, 2009, 01:24 PM posted to microsoft.public.access.tablesdbdesign
Eirik
external usenet poster
 
Posts: 7
Default Initiate VB code remotely

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
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 08:08 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.