I need to be able to keep my table from automatically sorting
itself, until I am finished entering the data & exit the page/form
Any assistance would be very much appreciated
Thanks in advance
JD Carter
I need to be able to keep my table from automatically sorting
itself, until I am finished entering the data & exit the page/form
Any assistance would be very much appreciated
Thanks in advance
JD Carter
You need to delete the primary index from the table, then sort it
manually afterwards, and maybe reindex it later.
--
+==========================================================================
|| Pretty good Paradox for Windows Programmer, self-proclaimed Treknologist ||
|| [ the rest of this sig is under construction until further notice... ] ||
+==========================================================================
--
Tel: +972 3 5388888, +972 3 5388853 Fax: +972 3 5331617
Mercury Interactive (Israel) Ltd P.O.B. 501, Or Yehuda 60218, Israel
World leader in Automated Software Testing
My suggestion is for you to use a temporary, unkeyed table while editing
data with your form. Create the temp table as a duplicate of the form's
master table, extract the records you need to edit (if appropriate) into
the temp table, open the form on the temp table, do your thing, and when
finished add the modified records back into the original table.
If you're working in a multiuser environment, you will have to do some
serious consistency checking, but it's fairly easy in a single-user
environment.
In general, though, its best to accept Paradox's way of doing things and
work with it.
Did you know that you can place and link data model tables using secondary
indexes as well as primary keys? That way, the records are still sorted,
but the way YOU want.
Kevin J Bluck
1. Problem while keeping a table sorted.
I have defined a TableModel (displayed in a JTable) which has two major
functions :
- keep the table sorted according to a unique key (the unique key, once
defined is not editable while other columns are)
- keep on top of the TableModel an empty row (on this row only the key is
editable).
This forces the user first to enter a key value before entering the values
associated to that key.
So what happens and what is the problem I encounter:
- when the user enters a new key : the setValueAt of the table model
process the following :
. updates the underlying database with a new record
. effectively set the Value in the model.
. add again an empty row at the beginning of the model
. fireTableRowsInserted
- as the model is build to always keep the keys in ascending order, the
fact of fireTableRowsInserted not only show the new empty row but also moves
the new key somewhere else.
My intention is to key the row with the row containing the newly added key
selected, so the user can continue entering the values. But this does not
work and as far as I know the TableModel has no notion of what is selected
in the JTable and has no way to force the selection of the row in the JTable
which shows the model.
An illustration to help understanding this:
Initially :
Rows Keys
1 _empty_ << The user has selected this row to edit the
key
2 2000
3 2100
4 2500
Suppose the user has entered the value 2400 as key.
After the fireTableRowsInserted the JTable looks like this :
1 _empty_ << An empty row is always added to allow
further addition
2 2000 << This row IS selected
3 2100
4 2400 << I would like to have this row selected
instead
5 2500
Could someboby help on this.
Thanks in advance
Bernard
3. Need Help Trying To Keep Form From Loading
5. Need help keeping form on top
6. transfer database from one SQL Server 6.5 to another SQL Server 6.5
8. After my table auto-sorts...I loose the that rec from my screen
9. How to auto increment number in Access Table through VB form
10. Keeping data from form to form
11. auto close of forms when tables are empty
12. up till 5am, need help bad, data control