Results 1 to 2 of 2

Thread: To fill a form

  1. #1
    Join Date
    Jul 2003
    Location
    Portugal
    Posts
    111

    Unanswered: To fill a form (is solved - don't need answer)

    Problem
    1. Form frmCase
    1.1. Table tblCase
    2. Table tblPeople

    I would like to fill the form frmCase
    with Name, Address...
    knowing the Personal_ID that is into the Table tblPeople.

    I'm sorry, but I'm bloqued...

    Can you help me, please? (by code)

    Thank you

    Ruas
    Last edited by jmruas; 12-14-03 at 15:14.

  2. #2
    Join Date
    Jul 2003
    Location
    Portugal
    Posts
    111
    I found the solution...

    Here is for those who needs this...

    Dim db As Database, rs1 As Recordset
    Dim rs2 As Recordset
    Set db = CurrentDb
    Set rs1 = db.OpenRecordset("Select * from tblPeople")
    rs1.Filter = "[Personal_ID] =" & Forms!frmCase![Personal_ID]

    Set rs2 = rs1.OpenRecordset ' here is the filtered record

    Forms!frmCase!Name = rs2!Name ' here we fill the form with data from the filtered record
    Forms!frmCase!Address= rs2!Address '
    ... ... ...

    Set rs2 = Nothing: Set rs1 = Nothing
    Set db = Nothing
    Last edited by jmruas; 12-14-03 at 15:11.

Posting Permissions

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