Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2009
    Posts
    1

    Unanswered: Finding record in a sub form using FINDRECORD

    Hello,
    I am trying to use the FindRecord function in my Access 2003 database.
    My simple code is:

    Dim Orderho As Integer
    Orderho = Me.cboFindByOrder
    Forms!test!Order!OrderID.SetFocus
    DoCmd.FindRecord Orderho, , True, , True

    It does not work when I use the variable, but will work if I put a number figure such as 12 in teh function for example
    DoCmd.FindRecord 12, , True, , True

    Is the problem with declaration of the variable?
    Any help would be appreciated thanks
    Peter

  2. #2
    weejas is offline Grumpy old man (training)
    Join Date
    Sep 2006
    Location
    Surrey, UK
    Posts
    1,105
    Provided Answers: 18
    When you run the subroutine using the variable, have you checked to see that it contains a value?
    10% of magic is knowing something that no-one else does. The rest is misdirection.
    Beers earned: 2

Posting Permissions

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