473,320 Members | 2,111 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Saving and Updating Records

Hello,
I have an Access 2000 Project in which the data comes from a SQL Server 2000
database, and multiple users need to be able to see new records as each user
adds records. The users also need to be aware of updates as they are made to
current records. The data the users are looking at is presented in a subform
that has the Default View property set to 'Single Form'.

In order for each user to see the update to the current record as each user
is looking at the current record, I have implemented the following code for
the onClick event of a button labeled 'Show Update to this Record':

dim bookmark as string
bookmark = me.bookmark
me.refresh
me.bookmark = bookmark

With this code, a user can make a change to a record, then another user on
the same record can click the 'Show Update to this Record' button (which
runs the above code), and then that other user can immediately see the
update that was made to the record by the other user.

All users also need to see new records as they are added by other users. My
first attempt at this has been a with a Macro assigned to the onClick event
of a second button labeled 'Save and Show New Records'. The macro looks like
this:

RunCommand - SaveRecord
RunCommand - RefreshPage
RunCommand - RecordsGoToLast

When a user adds a record, and then clicks the 'Save and Show New Records'
button, the other users can click the same button and see the new records
added. Another user can update the new record, and the other users can see
the new update to the new record by clicking the 'Show Update to this
Record' without navigating away from that record.

However, I am having a problem with the following sceanrio:

1. User 'A' adds record 1 and clicks 'Save and Show New Records'.
2. User 'B' clicks 'Save and Show New Records' to see record 1.
3. User 'B' makes a change to record 1.
4. User 'A' clicks 'Show Update to this Record' and can see the update to
record 1.
5. User 'A' adds record 2 and clicks 'Save and Show New Records'.
6. User 'B' clicks 'Save and Show New Records' and can see record 2.
7. User 'B' goes back to record 1 clicks 'Show Update to this Record' to see
if anything has changed with record 1.
8. User 'A' adds record 3 and clicks 'Save and Show New Records'.
9. User 'B' clicks 'Save and Show New Records' to see record 3, but even
though the navigation bar indicates there is a third record, user 'B' cannot
navigate to it without closing the entire form and reopening it.

The bottom line is that I need suggestions that will make new records
available to all users as they are added by any other user, and make updates
available to all users in the same way.

Please let me know if you have any ideas on this.

Thanks for your help!

CSDunn
Nov 12 '05 #1
3 8543
Use Requery instead of Refresh.

--
MGFoster:::mgf
Oakland, CA (USA)

CSDunn wrote:
Hello,
I have an Access 2000 Project in which the data comes from a SQL Server 2000
database, and multiple users need to be able to see new records as each user
adds records. The users also need to be aware of updates as they are made to
current records. The data the users are looking at is presented in a subform
that has the Default View property set to 'Single Form'.

In order for each user to see the update to the current record as each user
is looking at the current record, I have implemented the following code for
the onClick event of a button labeled 'Show Update to this Record':

dim bookmark as string
bookmark = me.bookmark
me.refresh
me.bookmark = bookmark

With this code, a user can make a change to a record, then another user on
the same record can click the 'Show Update to this Record' button (which
runs the above code), and then that other user can immediately see the
update that was made to the record by the other user.

All users also need to see new records as they are added by other users. My
first attempt at this has been a with a Macro assigned to the onClick event
of a second button labeled 'Save and Show New Records'. The macro looks like
this:

RunCommand - SaveRecord
RunCommand - RefreshPage
RunCommand - RecordsGoToLast

When a user adds a record, and then clicks the 'Save and Show New Records'
button, the other users can click the same button and see the new records
added. Another user can update the new record, and the other users can see
the new update to the new record by clicking the 'Show Update to this
Record' without navigating away from that record.

However, I am having a problem with the following sceanrio:

1. User 'A' adds record 1 and clicks 'Save and Show New Records'.
2. User 'B' clicks 'Save and Show New Records' to see record 1.
3. User 'B' makes a change to record 1.
4. User 'A' clicks 'Show Update to this Record' and can see the update to
record 1.
5. User 'A' adds record 2 and clicks 'Save and Show New Records'.
6. User 'B' clicks 'Save and Show New Records' and can see record 2.
7. User 'B' goes back to record 1 clicks 'Show Update to this Record' to see
if anything has changed with record 1.
8. User 'A' adds record 3 and clicks 'Save and Show New Records'.
9. User 'B' clicks 'Save and Show New Records' to see record 3, but even
though the navigation bar indicates there is a third record, user 'B' cannot
navigate to it without closing the entire form and reopening it.

The bottom line is that I need suggestions that will make new records
available to all users as they are added by any other user, and make updates
available to all users in the same way.

Please let me know if you have any ideas on this.

Thanks for your help!

CSDunn


Nov 12 '05 #2
I changed the code for the onClick event of the button "Show Update to
this Record" as follows:

Dim varBookMark As Variant
varBookMark = Me.Recordset.bookmark
Me.Requery
Me.Recordset.bookmark = varBookMark

If I left the macro for the button 'Save and Show New Records' as
follows:

RunCommand - SaveRecord
RunCommand - RefreshPage
RunCommand - RecordsGoToLast

I still have the same problem. If I change the Macro as follows:

RunCommand - SaveRecord
Requery - Text65
RunCommand - RecordsGoToLast

I get the following message after I click 'Save and Show New Records':
"You can't use the ApplyFilter action on this Window". I have tried to
apply the Requery to the subform object itself, a bound control, and an
unbound control.

Why would I get this message when I attempt to Requery?

Thanks again!

CSDunn

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 12 '05 #3
I don't know. It's one of those "I'd have to see it to understand why
it is acting like it does." That wasn't a request for your application :-).

--
MGFoster:::mgf
Oakland, CA (USA)

Chris Dunn wrote:
I changed the code for the onClick event of the button "Show Update to
this Record" as follows:

Dim varBookMark As Variant
varBookMark = Me.Recordset.bookmark
Me.Requery
Me.Recordset.bookmark = varBookMark

If I left the macro for the button 'Save and Show New Records' as
follows:

RunCommand - SaveRecord
RunCommand - RefreshPage
RunCommand - RecordsGoToLast

I still have the same problem. If I change the Macro as follows:

RunCommand - SaveRecord
Requery - Text65
RunCommand - RecordsGoToLast

I get the following message after I click 'Save and Show New Records':
"You can't use the ApplyFilter action on this Window". I have tried to
apply the Requery to the subform object itself, a bound control, and an
unbound control.

Why would I get this message when I attempt to Requery?

Thanks again!

CSDunn

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!


Nov 12 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: | last post by:
Hello, Sorry to ask what is probably a simple answer, but I am having problems updating a table/database from a PHP/ PHTML file. I can Read From the Table, I can Insert into Table/Database, But...
0
by: Mike | last post by:
I have two tables one on SQLServer and one on DB2. I want to update SQLSERVER table with some information that is on the DB2 table. I have unique id to match the records. I want to refresh some...
0
by: Stephen | last post by:
I have two databases and I am trying to do something with the Merge table in one database and am having a little difficulty writing the logic. Basically in DB1 I have a table which is full of...
2
by: Gene Vital | last post by:
Hi all. I am using Visual FoxPro via ODBC to update records on a 7.3.4 PostgreSql server and it appears that it always uses delete/insert instead of updating the current record. Can this be...
1
by: P | last post by:
Hello, I am having a difficult time updating a record via a stored procedure using the gridview and sqldatasource. I cannot seem to be able to find a way to set everything up so that I can pass...
2
by: Alexey.Murin | last post by:
The application we are developing uses MS Access 2003 database (with help of ADO). We have noticed that during massive records updating the size of the mdb file increases dramatically (from 3-4 to...
0
by: pmaers | last post by:
I need a source code in Visual Basic .Net regarding about updating data records using MS Access database (.MDB).
2
by: najimou | last post by:
Hi I have a subform where the user make changes to several filtered records in view. when clicking the updating button, I run the update query to perform some calculations and update the table...
11
by: xelA | last post by:
Thanks, it worked. Another problem: Hey folks, where is the bug in this code? When updating the date field, it is updating all the records in the table with the same value (e.g. 2008-01-07) instead...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.