We help IT Professionals succeed at work.

inserting "between" records

Glen Gibb
Glen Gibb asked
on
My data entry program is for keyers who work from cards.

The EntryNum (PK) of the recordset is kept from the user.

If a user has entered data in consecutive records, but has mistakenly flipped two cards (say cards 51 and 52) at once and entered data from a new card (card 53), then data from card 52 will need to be "inserted."

Of course the rs contains the data in rows 51 and 52.  How can row 51.5(x) be obtained with a minimum of fuss?

A code snippet, svp?
Comment
Watch Question

Hi alberta

What is the backend that ur using
Commented:
if it is Ur Important key to data

opening Ur recordset  ORDER BY FieldNo


rs.open "SELECT * FROM TableName ORDER BY FieldNo" ,....,,,

So Don't care of Inserting

Commented:
Sorry of course if u use ADO

if sequential or random or binary files tell us
Glen GibbOwner

Author

Commented:
True, the SQL statement does make it unnecessary to "insert."

My problem was to find a suitable RecNo between two integers.

The solution for the "insert" I had in mind was to make the PK into a double (rather than a counter).

To place an entry between 51 and 52 you MovePrevious to find the previous RecNo, add it to the current RecNo and divide the total by two.

Then requery the rs (as you suggested).

Tnx.

Explore More ContentExplore courses, solutions, and other research materials related to this topic.