Viewing the current record after requery a form

  • Follow


Hi,

I'm trying to get code or setting on the current record view. 
Each time when I update a record (rec A) into my form, I need to run a 
Requery before I continue to the Date field. But after the Requery runs, the 
redord has goes to the first record 9rec B) of the form and I need to search 
for the record (rec A) to continue my data updating.

Are there anyway to view the current record after I requery the form?

Thank you.

Eric
0
Reply Utf 3/3/2008 6:23:01 AM

Eric,
there is a function called RowNumber created by Stehpan Lebans that you can 
use to return to the previous record.
Here is the link
http://www.lebans.com/rownumber.htm

Jeanette Cunningham


"Eric" <Eric@discussions.microsoft.com> wrote in message 
news:1D38C6E7-3507-46B5-A369-83B18F508AB4@microsoft.com...
> Hi,
>
> I'm trying to get code or setting on the current record view.
> Each time when I update a record (rec A) into my form, I need to run a
> Requery before I continue to the Date field. But after the Requery runs, 
> the
> redord has goes to the first record 9rec B) of the form and I need to 
> search
> for the record (rec A) to continue my data updating.
>
> Are there anyway to view the current record after I requery the form?
>
> Thank you.
>
> Eric 


0
Reply Jeanette 3/3/2008 11:32:38 AM


Use the form's After Update event.  In this example, the field [PrimeKey] is 
the primary key of the table. and txtPrimeKey is the control on the form that 
is bound to [PrimeKey]

Dim lngKeyValue as Long

    lngLeyValue = Me.txtPrimeKey
    Me.Requery

    With Me.RecordsetClone
        .FindFirst "[PrimeKey] = " & lngKeyValue
        If Not .NoMatch Then
            Me.Bookmark = .Bookmark
        End If
    End With
-- 
Dave Hargis, Microsoft Access MVP


"Eric" wrote:

> Hi,
> 
> I'm trying to get code or setting on the current record view. 
> Each time when I update a record (rec A) into my form, I need to run a 
> Requery before I continue to the Date field. But after the Requery runs, the 
> redord has goes to the first record 9rec B) of the form and I need to search 
> for the record (rec A) to continue my data updating.
> 
> Are there anyway to view the current record after I requery the form?
> 
> Thank you.
> 
> Eric
0
Reply Utf 3/3/2008 2:47:01 PM

2 Replies
560 Views

(page loaded in 0.064 seconds)

Similiar Articles:
















7/21/2012 1:14:40 AM


Reply: