Trying again for opening another form

  • Thread starter Thread starter Annelie
  • Start date Start date
A

Annelie

I have a data entry subform, where the main table comes from a query which
is based on the TblEmployeeList. The query shows only active employees. The
employee is selected from a combo box.

If an employee is not on the on the list, I would like to have a button
which would open the frmEmployeeList. But I get message that the
tblEmployeeList is already opened exclusively by another user.

There has to be a way to suspend the current form and open the
frmEmployeeList.
Annelie
 
Open the forms in design view then open the Properties sheet. On the data
tab, what do you show for the Record Locks option? What is your version of
Access?
 
A couple of more questions. Where is the table located, the current database
or another one? Are you opening the database with Exclusive access?
 
It is dynaset no locks
My version is Access 2003, the default file format is Access 2002 -2003.
The database is split, so the tables sit in data.mdb and the front is called
PciDB.mdb
Default open mode is shared, default record locking is edited records
and Open databases using record-level locking
Annelie
 
1) With the database closed on all computers, look for an ldb file with the
same name as the mdb file in the same folder as each of the mdb files. If it
exists with no one using the database, delete the ldb file, it has been left
over from a previous session that failed to delete it automatically.

2) In the Tools|Options menu, try setting default locking to No Locks.

3) Open the query that feeds each form in design view. Right click the
background where the tables are placed and choose Properties. What is the
Record Locks setting of the query? In not No Locks, try setting it to No
Locks.

4) You say that the Default Open Mode is Shared; however, are you opening
the database from an icon that may have /excl in its command line? This
would over ride the Default Open Mode.

5) Do you have a "dirty" record on the first form when you try to open the
second one?

6) Could there be anything in the code behind either of these forms that may
be locking the table (querydefs, recordsets, etc)?
 
Right now I am only working on my laptop and I have seen an lbd file, at
times, but it is not there now.
Everything you asked me is fine. I looked through the codes and I see
nothing that should cause a problem. Both are very simple forms, done by
someone that used the wizard for everything, except the items that I get
responses to from the newsgroup.

My code for the button is:
Cmd.Close
Then goes to the open event.
It actually closes the form with current week data, but I still get the
error message.

The only items that did not come from the wizard are for the combo boxed and
here are the codes

Private Sub EmployeeSelect_AfterUpdate()
DoCmd.GoToControl "EmployeeID"
DoCmd.FindRecord Me![EmployeeSelect]
End Sub

Private Sub EmployeeSelect_Change()
EmployeeSelect.Dropdown
End Sub

Private Sub Form_Current()
Me.EmployeeSelect = Me.EmployeeID
End Sub

Private Sub Form_Open(Cancel As Integer)
DoCmd.GoToRecord , , acNewRec
Me![EmployeeSelect] = Null
End Sub

Can any of these cause the problem?
Annelie
 
I found it, you made me look again and again. I checked it before and did
not see it. The FrmEmployeeList show for Record locks "All Record". I
changed it to no locks and it now opens the Employee List.
It even works without closing the current form.
Thanks for making me look at all those items.
So now I have to scroll the newsgroups again to make sure that the changes
made on the form, are carried over to the other from. I have seen a lot of
posts.
Thank you so much,
Annelie


Annelie said:
Right now I am only working on my laptop and I have seen an lbd file, at
times, but it is not there now.
Everything you asked me is fine. I looked through the codes and I see
nothing that should cause a problem. Both are very simple forms, done by
someone that used the wizard for everything, except the items that I get
responses to from the newsgroup.

My code for the button is:
Cmd.Close
Then goes to the open event.
It actually closes the form with current week data, but I still get the
error message.

The only items that did not come from the wizard are for the combo boxed and
here are the codes

Private Sub EmployeeSelect_AfterUpdate()
DoCmd.GoToControl "EmployeeID"
DoCmd.FindRecord Me![EmployeeSelect]
End Sub

Private Sub EmployeeSelect_Change()
EmployeeSelect.Dropdown
End Sub

Private Sub Form_Current()
Me.EmployeeSelect = Me.EmployeeID
End Sub

Private Sub Form_Open(Cancel As Integer)
DoCmd.GoToRecord , , acNewRec
Me![EmployeeSelect] = Null
End Sub

Can any of these cause the problem?
Annelie

1) With the database closed on all computers, look for an ldb file with the
same name as the mdb file in the same folder as each of the mdb files.
If
 
Back
Top