Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 2004
    Location
    Florida
    Posts
    9

    Unanswered: Access 2000, Where Clause or FindRecord

    Hi,

    I have a DB with 8 forms and a switchboard for tracking project information. I have a "Jump To" Combo Box on each form with the purpose of opening another form, and going to the "Project_Number" (field) on the opened form that matches the same filed on the current form (ie, Project_Number 4138 is selected on my "Funding" Form, I want to open the "Design" Form and go to Project_Number 4138.) Here is what I have tried:

    Dim stDocName As String
    Dim stLinkCriteria As String

    stDocName = Combo38
    stLinkCriteria = Me![Project Number]
    DoCmd.OpenForm stDocName
    DoCmd.FindRecord stLinkCriteria

    This opens the form, and does not go to the correct record.

    Dim stDocName As String
    Dim stLinkCriteria As String

    stDocName = Combo38
    stLinkCriteria = "[Project Number] = " & Me![Project Number]
    DoCmd.OpenForm stDocName, , , stLinkCriteria

    This opens the form, goes to the correct record, but filters out all other records, which I do not want either.

    I tried various options with setfocus and gotorecord, none of which worked. Any help will be greatly appreciated.

    TB

  2. #2
    Join Date
    Mar 2004
    Location
    www.scirocco.ca
    Posts
    346
    Use the form's recordset instead like this:

    Code:
    stLinkCriteria = "[Project Number] = " & Me![Project Number]
    Forms!NameOfYourForm.Recordset.Find stLinkCriteria, 0, adSearchForward, 1
    http://www.scirocco.ca/images/banner...occobanner.gif

    Download for FREE the ADO/DAO Data Controls that makes life EASIER developing database applications in: VB, FoxPro, Access, VC++, .NET etc... Navigate, Add New, Delete, Update, Search, Undo and Save your changes. Supports Disconnected Recordsets and Transactions!

    Or try our Ask An Expert service to answer any of your questions!

Posting Permissions

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