How to open two instances of a Form and select record

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rk2008
    New Member
    • Mar 2008
    • 3

    How to open two instances of a Form and select record

    Hi,
    I'm using following code to select a record on a form from dropdown list and I'm using MSSQL ODBC linked tables inside MS Access:
    Code:
    Private Sub cboFind_AfterUpdate()
      Dim strCriteria As String
      Dim rst As DAO.Recordset
     
      Set rst = Me.RecordsetClone
       strCriteria  = "[EmployeeID] = " & Me![cboFind]
     
      rst.FindFirst strCriteria
      Me.Bookmark = rst.Bookmark
    
    End Sub
    But I have a problem, if one person opens form A and select one of the records from the dropdown list it works fine. Now at the same time if second person open the same form A from the same copy of MSAccess the first form A starts pointing to the new record selected by second person and save changes to the newly selected record. How can I prevent this from happening, so that each instance of form A points to its selected record?

    Thanks
  • PianoMan64
    Recognized Expert Contributor
    • Jan 2008
    • 374

    #2
    You have to create a new form with a new recordset. otherwise whatever you do in the second form will refect in the first one until you break the chain between the two.

    If you want to open multipule copys of the form A, then you're going to need to create them in VBA for each one you want to have open. This isn't something MS Access supports because it assumes that it has only one recordset per form.

    If you need code examples, please let me know.

    Thanks,

    Joe P.

    Comment

    Working...