Connecting Tech Pros Worldwide Help | Site Map
Reply
 
LinkBack Thread Tools Search this Thread
  #1  
Old March 26th, 2008, 11:07 PM
Newbie
 
Join Date: Mar 2008
Posts: 3
Default 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:
Expand|Select|Wrap|Line Numbers
  1. Private Sub cboFind_AfterUpdate()
  2.   Dim strCriteria As String
  3.   Dim rst As DAO.Recordset
  4.  
  5.   Set rst = Me.RecordsetClone
  6.    strCriteria  = "[EmployeeID] = " & Me![cboFind]
  7.  
  8.   rst.FindFirst strCriteria
  9.   Me.Bookmark = rst.Bookmark
  10.  
  11. 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
Reply


  #2  
Old March 29th, 2008, 08:19 AM
Expert
 
Join Date: Jan 2008
Age: 44
Posts: 349
Default

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.
Reply
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 205,414 network members.