Results 1 to 2 of 2
  1. #1
    Join Date
    Jul 2003
    Posts
    42

    Unanswered: Requery question

    I need to know how to requery a record. I currently have the form set to Requery.Me but everytime I do that it jumps me to the first record and but I need it to requery the current record and not drop me back to the first one.

    thanks

  2. #2
    Join Date
    Jul 2003
    Posts
    42

    Re: Requery question

    Nevermind figured it out:

    FYI the answer is below...

    Dim k as integer
    YourForm.SetFocus
    k = Me.CurrentRecord


    '(your stuff happens here)


    Me.Requery
    DoCmd.GoToRecord , , acGoTo, k

    'To get back to the control (textbox bound to a field) that the user was on previous to the requery you add:

    Dim strControl As String

    run other code

    me![strVariable].SetFocus 'or Docmd.GoToControl strControl
    strControl = Me.ActiveControl.Name

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •