Re: Live record counts
- From: Marshall Barton <marshbarton@xxxxxxxxxx>
- Date: Tue, 03 Apr 2007 17:47:23 -0500
TOMAC wrote:
We have 2 MS Access front end guis we use to enter data into an MS Access
master table, stored in a llinked MS Access database on a shared network
drive. I want to be able to run a procedure/macro whenever the record count
in the master table increases. I can tell when I add a record to this table
becasue I hit the save record button. However, I need to run the same
procedure/macro when the other user updates the table too without exiting the
data entry gui.
Does anyone have any idea how I can tell if the master table has been
updated by the other user?
Not sure if this is the proper place to post this but thanks in advance to
anyone who can point me i teh right direction!
Without triggers, you would have to query the table to see
to see if the number of records has changed. If there is a
point where you need this information, then do it there. If
you want to monitor this asynchronously from your normal
activities, use a form's Timer event.
There are several ways to check the number of records in a
table, but this is pretty straightforward:
Static RecCnt
Dim NewCnt As Long
Dim rs As Recordset
Set rs = Currentb>OpenRecordset("SELECT Count(*) " _
& "FROM thetable")
NewCnt = rsFields(0)
rs.Close : Set rs = Nothing
If RecCnt <> NewCnt Then
' record added or deleted
' do something
RecCnt = NewCnt
End If
--
Marsh
MVP [MS Access]
.
- Prev by Date: Re: select statement question
- Next by Date: Re: Combo box multi autocomplete
- Previous by thread: Re: Live record counts
- Next by thread: Re: Live record counts
- Index(es):
Relevant Pages
|