Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Displaying a Mssg when new records added to a Table

Status
Not open for further replies.

Gazer44

Technical User
Mar 4, 2002
211
US
How can I display a mssg when another user adds a NEW record to a table.

(This is for a database which many users keep open but constantly minimise & maximise to see updates)

When the database is minimised on the tool bar and a mssg saying 'new record added' is flagged up, I'd like the icon on the toolbar to Flash (like it does when a system mssg appears waiting for user action)

If this isn't possible, then just to have a mssg-'new record added' flagged up and left on the screen, so when users maximise the database , the mssg is there waiting.

(This is for a database which many users keep open but constantly minimise & maximise to see updates)

Any help/ideas always appreciated, cheers
 
I believe the tools are available to develop any solution, but they may involve tools and capabilities outside of Access. 1) You need to realize that there is no event for tables like 'RecordAdded' so there is no standard way for the Access database to recognise a record has been added. The front-end merely has a pointer to the tables in the back-end. 2) Also, Access doesn't provide the user with any native means of recognizing who is on the system. How would it do that if users don't have security the each one is logged on as the default 'Admin' user. 3) And finally, there is no native communications link to be able communicate with other users, even if you were 'data aware'. Having said what the barriers are there are ways of overcoming them through design, Windows calls, hardware, and network technologies.

Alternatives:
1a. Open a recordset for a table that you want to modify, store a variable for the Recordset.RecordCount. Then refresh the recordset from the table based on a timer interval you set to compare the PreviousRecordCount to the CurrentRecordCount.
1b. For each record addition store a record to the event in a log table saying what table was changed, the date/time it changed, and who changed it. Based on a timer, have each client application search the log table for additions that are within a certain period of time. Probably the length of the timer and add this to a form control. This 'Monitor' form would probably be invisible and constantly monitoring the log records. This could be a means of overcoming the communications limitations.
2a. Develop a feature to read the .ldb file to determine who is logged in to the database. Ensure the database has user security established so each user could be known for their username.
2b. Develop a feature to have each user log in to the database. The information is then added to a table showing who logged on and when they logged on. When they quit the database they are then added to the table as a 'loggedout' or their original record is removed from the table.
3a. Use the machine name which could be derived from the .ldb file and use Windows pipes to send a message to the user. I have this feature for Windows NT based systems be not other systems.
3b. Use one of the passive daemon monitor features mentioned in 1a or 1b above.

I guess you need to decide how determined you are to build a solution for the requirements as you stated them. Each one of the alternatives has advantages and disadvantages. Each could result in significant amounts of time spent designing and implementing a solution.

Steve King
Growth follows a healthy professional curiosity
 
Thanks for the ideas Steve, complicated stuff!
It is a difficult one but basically if I can flag up a mssg when a new record is added then that would be OK.

Option 1a) sounds poss like the best for me, can you give me some VBcode for this as I'm fairly new to VB.

Much appreciated,

Gary
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top