Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2002
    Posts
    4

    Unanswered: Sending a record number to a form

    I need to find a record in a form(which i have done) then display the selected record in the main data entry window. how do i transfer the record number bewteen two forms?

  2. #2
    Join Date
    Oct 2001
    Location
    Chicago
    Posts
    440
    This can be performed many ways.

    You could recode the recordsource including the record number in the where clause and requery the form

    Forms![Employees_f].Recordsource = "Select * from Employee_t where [EmployeeID] = " & Me![SelectItem].Column(0)
    Forms![Employees_f].requery

    here's another method - this bit of code is from a employee selector form that selects an employee on the Employees_f form.

    Private Sub btnOK_Click()

    Dim criteria As String
    criteria = "[EmployeeID] = " & Me![SelectItem].Column(0)
    Forms![Employees_f].RecordsetClone.FindFirst criteria
    If Forms![Employees_f].RecordsetClone.NoMatch Then
    Else
    Forms![Employees_f].Bookmark = Forms![Employees_f].RecordsetClone.Bookmark
    End If
    DoCmd.Close acForm, Me.NAME


    End Sub

Posting Permissions

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