473,396 Members | 1,726 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,396 software developers and data experts.

Check boxes Access 2002 FE SQL Server 2000 BE update problem

aaj
Hi all

I have a continuous bound form and on each record is a tick box.

The user ticks the boxes and these boxes define the batch. for future
operations

before they leave the page I count the number of ticks using (ADO)

rst.Open "SELECT COUNT(update_po_ref) AS update_qty FROM dbo.tbl_forecasted
GROUP BY update_po_ref HAVING (update_po_ref = 1)"

and notify the operator. This works OK.

So to improve things, in the footer of the form I but a text box, and on
each check box, use the 'after update' event to call the function where the
above code lives and then update the text box.

So in theory,
user clicks the checkbox
access bound form updates sql server backend
when data has been written the 'after update' event triggers
after update event runs the select and counts the number of ticks and
updates the screen

so finally on to the problem.... The count is always one behind the form. If
you click on a check box, the event fires ok ( I can use the break to trace
it), but even though its the after update event, when I run the select, the
database doesn't seem to have been updated.

I've tried doevents before running it and that didn't work. The only way it
works is if I use me.requery or me.refresh after the click but before the
select. This seems to force the write to the database The problem with this
is the list always defaults back to the top. I know I could remember which
record the last update was on and then find it again, but it seems an awful
long way of doing things

thanks in advance for any ideas

Andy

Nov 13 '05 #1
2 2344
aaj wrote:
Hi all

I have a continuous bound form and on each record is a tick box.

The user ticks the boxes and these boxes define the batch. for future
operations

before they leave the page I count the number of ticks using (ADO)

rst.Open "SELECT COUNT(update_po_ref) AS update_qty FROM dbo.tbl_forecasted
GROUP BY update_po_ref HAVING (update_po_ref = 1)"

and notify the operator. This works OK.

So to improve things, in the footer of the form I but a text box, and on
each check box, use the 'after update' event to call the function where the
above code lives and then update the text box.

So in theory,
user clicks the checkbox
access bound form updates sql server backend
when data has been written the 'after update' event triggers
after update event runs the select and counts the number of ticks and
updates the screen

so finally on to the problem.... The count is always one behind the form. If
you click on a check box, the event fires ok ( I can use the break to trace
it), but even though its the after update event, when I run the select, the
database doesn't seem to have been updated.

I've tried doevents before running it and that didn't work. The only way it
works is if I use me.requery or me.refresh after the click but before the
select. This seems to force the write to the database The problem with this
is the list always defaults back to the top. I know I could remember which
record the last update was on and then find it again, but it seems an awful
long way of doing things


The problem is that after you have ticked the box, the record is dirty,
i.e. not yet saved, therefore will not show up in any query based on the
underlying table.

You can force the record to save in the afterupdate event before
triggering your counting query.

--

\\\\\\
\\ \\ Windows is searching
\ \ For your sig.
\ \ Please Wait.
\__\

Nov 13 '05 #2
aaj
your the man Trevor 8-)

the following did the trick

If Me.Dirty Then
DoCmd.RunCommand acCmdSaveRecord
End If
many thanks

Andy

"Trevor Best" <nospam@localhost> wrote in message
news:41***********************@auth.uk.news.easyne t.net...
aaj wrote:
Hi all

I have a continuous bound form and on each record is a tick box.

The user ticks the boxes and these boxes define the batch. for future
operations

before they leave the page I count the number of ticks using (ADO)

rst.Open "SELECT COUNT(update_po_ref) AS update_qty FROM dbo.tbl_forecasted GROUP BY update_po_ref HAVING (update_po_ref = 1)"

and notify the operator. This works OK.

So to improve things, in the footer of the form I but a text box, and on
each check box, use the 'after update' event to call the function where the above code lives and then update the text box.

So in theory,
user clicks the checkbox
access bound form updates sql server backend
when data has been written the 'after update' event triggers
after update event runs the select and counts the number of ticks and
updates the screen

so finally on to the problem.... The count is always one behind the form. If you click on a check box, the event fires ok ( I can use the break to trace it), but even though its the after update event, when I run the select, the database doesn't seem to have been updated.

I've tried doevents before running it and that didn't work. The only way it works is if I use me.requery or me.refresh after the click but before the select. This seems to force the write to the database The problem with this is the list always defaults back to the top. I know I could remember which record the last update was on and then find it again, but it seems an awful long way of doing things


The problem is that after you have ticked the box, the record is dirty,
i.e. not yet saved, therefore will not show up in any query based on the
underlying table.

You can force the record to save in the afterupdate event before
triggering your counting query.

--

\\\\\\
\\ \\ Windows is searching
\ \ For your sig.
\ \ Please Wait.
\__\

Nov 13 '05 #3

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

Similar topics

11
by: Wolfgang Kaml | last post by:
Hello All, I have been working on this for almost a week now and I haven't anything up my sleeves anymore that I could test in addition or change.... Since I am not sure, if this is a Windows...
3
by: RAD | last post by:
I am working with an evaluation copy of SQL Server 2000 for the first time; my DB experience lies with MS Access. I have a simple table in SQL Server (tblCompany) that has a field called...
2
by: Ben | last post by:
My current project requires me to create part of a form that is created on the fly. The project consists a list of entries to an event. The name and address and such is easy. The design is detup so...
20
by: John | last post by:
Hi, I've recently upgraded from Access 97 to Access 2002 & the performance basically stinks. I have tried the following items listed below but it has only had a minor impact: 1) Upgraded Jet...
4
by: Squirrel | last post by:
I've developed an Access 2002 database which will be deployed with the backend on a server and frontend on the users' PCs. I've now been advised that new employees will be given laptops with...
3
by: dd_bdlm | last post by:
I have been working for a couple of months now with an old access 97 database. I have managed to make necessary adjustments but its been at times a struggle. I have now been commissioned to...
47
by: ship | last post by:
Hi We need some advice: We are thinking of upgrading our Access database from Access 2000 to Access 2004. How stable is MS Office 2003? (particularly Access 2003). We are just a small...
2
by: TechBoy | last post by:
I am trying to learn on the fly about Access Security for an app we are developing. I realize Access security is an advanced subject with many details. I wanted to share a scenario and ask a...
52
by: Neil | last post by:
We are running an Access 2000 MDB with a SQL 7 back end. Our network guy is upgrading to Windows Server 2003 and wants to upgrade Office and SQL Server at the same time. We're moving to SQL Server...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.