473,396 Members | 1,894 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.

Continous Form- How to retain sort order and cursor position after edit

Hi.

I have a form with continuous forms and a data entry section in the
header of the form. (I.e. all transactions show in the main form area
like a data sheet and the data for the highlighed tran is entered or
edited in the header.)

Record source for the form is a query that is sorted by tran date.

Records are sorted by date of transaction ascending.

MY PROBLEM:

When I enter a new transaction or change the date in an existing
transaction, I cannot get the transactions to resort themselves into
the proper order.

It is important that they be in date order as I have a running total of
the balance of funds on hand in the right most column.

The only way I have been able to get the records to resort is to close
and reopen the form OR requery the form. Problem with requerying the
form is that it moves the cursor off the current record on to an
arbitrary record.

I am sure this is SIMPLE, but I am stuck! What I need is a way to keep
the records sorted correctly while keeping the cursor on the same
record. Using bookmarks won't work because you lose bookmarks when you
requery a recordset.

Keith

Nov 13 '05 #1
1 3052
DFS
So******@gmail.com wrote:
Hi.

I have a form with continuous forms and a data entry section in the
header of the form. (I.e. all transactions show in the main form area
like a data sheet and the data for the highlighed tran is entered or
edited in the header.)
Is there a reason you're not editing the data directly in the main form
area?

Record source for the form is a query that is sorted by tran date.

Records are sorted by date of transaction ascending.

MY PROBLEM:

When I enter a new transaction or change the date in an existing
transaction, I cannot get the transactions to resort themselves into
the proper order.

It is important that they be in date order as I have a running total
of the balance of funds on hand in the right most column.

The only way I have been able to get the records to resort is to close
and reopen the form OR requery the form. Problem with requerying the
form is that it moves the cursor off the current record on to an
arbitrary record.

I am sure this is SIMPLE, but I am stuck! What I need is a way to keep
the records sorted correctly while keeping the cursor on the same
record. Using bookmarks won't work because you lose bookmarks when you
requery a recordset.
It's pretty simple. I've faced it myself with continuous forms, when
inserting or updating, though not exactly as you describe.

One fix I used was to record the ID of the current record, do the insert or
update, issue the requery, then use a little code to find the ID.

Assuming you have button(s) to add new or update existing records:

Public Sub btnAddUpdate()

'GET ID VALUE OF RECORD BEING EDITED
dim recordID as long
recordID = me.subForm.recordID

'... execute the update or insert
'FIND THE RECORD YOU WERE EDITING
Me.subForm.SetFocus
DoCmd.GoToControl "ID_Field"
DoCmd.FindRecord recordID, acEntire, , acSearchAll, , acCurrent
DoCmd.RunCommand acCmdSelectRecord

End Sub
Keith

Nov 13 '05 #2

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

Similar topics

2
by: JK | last post by:
Hi All, I am working a form which is tabular layout (continuous form) which will display multiple records at a time. Each line of record needs to be reflected on the color code to show their...
1
by: adolph | last post by:
I would like to add a check box to the detail area of a continous form. So that I can check on specific records, then after I've marked all the records I watn to delte, click a button to loop thru...
0
by: gavo | last post by:
Hi. using A2K; i have a form containing a continous subform. The question is, how can i call a calculation for one of the fields in the continous subform from the main form. At the moment i...
0
by: ReidarT | last post by:
I have started to develop in vb.net. Earlier development was in MS-Access. I need a lot of continous forms to present data. The customer add and edits data in the continous form. Is use of...
5
by: kaisersose1995 | last post by:
Hi, I am trying to add some visual confirmation to a continous form, to let the user know if a stored date on the form has passed. I have managed to set the background colour using a simple IF...
5
by: Nothing | last post by:
I have a search results form that is being displayed as a continous form. I want to double click the name and then using VBA select the different columns of information. For Example: Name ...
1
by: Kev | last post by:
Hi, I am trying to total a column (Shift1) in a subform (continous forms) from the after update event of the (Shift1) column control within the subform. This column stores shift codes, I want to...
2
by: access baby | last post by:
How do i create continous form i created main form with subform drag and drop into main form but the subform shows me the 1st record of the customer . how can i link main form with subform i tried...
2
by: questionit | last post by:
Hi I know how to implement Continous form. In the method i have tried, the source for data on the continous form comes from table using SQL query Now, i want to try something different and i...
5
by: AccessHunter | last post by:
Hi, I have a continous form that displays Name and Address of Suppliers. In the form there is a combo box for 'Active Address' and 10 other text boxes. All the fields coem from one table,...
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:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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...

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.