New Record pointer

  • Thread starter msnews.microsoft.com
  • Start date
M

msnews.microsoft.com

Hello,
I am using my own navigation buttons on a form and displaying the record
posions on a label e.g. "x of total records" I am using a bound table .
whenever i add a new record it goes to the last of recordset , is there any
way to display it at the same location where i am adding it.like adding in
order(ascending). I am using me.requery but it makes me reach at 1st record
while i want to remain at the same locatio where i was. also i am tiered of
error "not a valid book mark"
pls tell me how i should handle this.
thanks
 
S

Sean

store the offset before requerying
check out the goto record command

maybe docmd.gotorecord or something

do this after requerying, using the stored offset
 
S

SA

This should be pretty straight forward.

When you add a record, theoretically it has value associated with the
primary key of the underlying table or recordset.

So step wise it might look like this:

1.) Form is filled with data, and committed (i.e. saved)
2.) Capture values of the primary key values into variables for the record
just created.
3.) Requery the form
4.) Create a recordset clone
5.) Use the find method to locate the record using the primary key values
stored in variables in item 2
6.) Capture the bookmark into a variable after a successful find.
7.) Set the form bookmark = to the value of the bookmark variable.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top