Opening a form based on the same table as the calling form

gbat

New member
Local time
Today, 10:16
Joined
Nov 29, 2005
Messages
8
Hi All

I have a form based on a table called tblListMaster and I want to allow users to open up another form showing all the members of one of the entries in that table so I have added a button called 'Show List Members'.

The list members form which I then want to bring up is also based on tblListMembers (it's a master-detail form). When I hit the button to open up the list members form I get an error message saying that the table is already opened exclusively.

I can understand why I get that message so I thought I would be cunning and create a dummy form which I open up, passing in my list id in the openargs (at that point I also close the original form) and then from that dummy form automatically open up the master detail form and close the dummy.

Code in List Master form
Code:
Private Sub cmdListMembers_Click()
    ' open up the list members form
 
    DoCmd.OpenForm "frmDummy", acNormal, , , , , Me.ListId
    DoCmd.Close
  
    
End Sub

Code in Form Load of dummy form

Code:
Private Sub Form_Load()
    
    DoCmd.OpenForm "frmMaintainListMembers", acNormal, , , , acWindowNormal, Me.OpenArgs
    DoCmd.Close
    
    
End Sub

Sadly I still get the same error message - does any one have any ideas what I'm doing wrong?


Gordon
 
Why do you have the table opened in the exclusive mode?
 
Is that a property setting somewhere?
 
Thanks - I just checked and it is in fact set to 'Shared'

However I have just got round the problem by using the Timer property on frmDummy , setting it to 5 and then calling the open on frmMaintainListMembers. Probably not very elegant but it works!
 

Users who are viewing this thread

Back
Top Bottom