table exclusively open by another user problem

antonyx

Arsenal Supporter
Local time
Today, 06:30
Joined
Jan 7, 2005
Messages
556
i have a form that uses a text box to search through my bookings, and when the user double clicks on the record in the listbox it loads that record in my main booking form..

this works fine. the problem is this..

i will search and find a record using the text filter.. i will double click on the record and it loads in the booking form.

i then close the booking form, and the search form is still open in the background..

if i then click on another record in the search form, i get this message..

runtime error 3008, the table bookings is already opened exclusively by another user... etc

below is the code in my search form, is there anyway it can be edited to make sure this doesnt happen.


Code:
Option Compare Database
Option Explicit


Private Sub QuickSearch_DblClick(Cancel As Integer)
DoCmd.OpenForm "newBOOKINGS", , , "[bookingid] = " & Me![QuickSearch].Column(0)
End Sub

Private Sub Search_Change()
Dim vSearchString As String

 vSearchString = Search.Text
 Search2.Value = vSearchString
 Me.QuickSearch.Requery

End Sub

Private Sub QuickSearch_AfterUpdate()
    
DoCmd.Requery
Me.RecordsetClone.FindFirst "[bookingid] = '" & Me![QuickSearch] & "'"
If Not Me.RecordsetClone.NoMatch Then
   Me.Bookmark = Me.RecordsetClone.Bookmark
Else
   MsgBox "Could not locate [" & Me![QuickSearch] & "]"
End If

End Sub
 
I presume that you are using macro to excute your open form command.
Create another macro with "save" action. Nothing more needed. Assign this macro to your search form under onCurrent event. Hopefully this works.
 
tkoh78 said:
I presume that you are using macro to excute your open form command.
Create another macro with "save" action. Nothing more needed. Assign this macro to your search form under onCurrent event. Hopefully this works.


i dont quite get you... the error is in this snippet

Code:
DoCmd.OpenForm "newBOOKINGS", , , "[bookingid] = " & Me![QuickSearch].Column(0)

End Sub

i open search form, double click on a record and it opens in the booking form..

i close the booking form...

then if i double click on another record in the search form (which is already opened), it gives me that error...

are you tellin me that i need to save the table inside the search form??

i dont understand, could you show me what you mean please..

the form is opened with a double click procedure in the listbox, as illustrated above..
 
tkoh78 said:
I presume that you are using macro to excute your open form command.
Create another macro with "save" action. Nothing more needed. Assign this macro to your search form under onCurrent event. Hopefully this works.


i dont quite get you... the error is in this snippet

Code:
DoCmd.OpenForm "newBOOKINGS", , , "[bookingid] = " & Me![QuickSearch].Column(0)

End Sub

i open search form, double click on a record and it opens in the booking form..

i close the booking form...

then if i double click on another record in the search form (which is already opened), it gives me that error...

are you tellin me that i need to save the table inside the search form??

i dont understand, could you show me what you mean please..

the form is opened with a double click procedure in the listbox, as illustrated above..
 

Users who are viewing this thread

Back
Top Bottom