Help to check code

R

Richard

Hi

I have been troubleshooting this form for weeks and still scratching my
head.

It is an enrolment form where when users click on the enrol button, the
EnrolmentId and ParticipantId is inserted into a one to many table,
Enrolment/Participant.

It works okay on the master, but ONLY somtimes when the users (mde) click,
an error msg "'The Microsoft Jet engin stopped the process because you and
anoth user are attempting to change the same data at the same time.'

I read a thread where it states that maybe a permission issue or another
instance is open. So, I assigned administer permissions to all users. The
users are still getting the error message and I'm stuck....

Many thanks in advance.

Richard


The code is onclick event of the enrol button.


Dim DB As dao.database

If IsNull(Me.cmbPart) Then
MsgBox "Please select name first!", , "WB"

Exit Sub

ElseIf Me.Dirty = True Then

Me.Dirty = False

Set DB = CurrentDb

DB.Execute ("INSERT INTO [Enrolment/Participant](EnrolmentID,
ParticipantID) VALUES (" & Me.EnrolmentID & ", " & Me.cmbPart & ");")
Set DB = Nothing
Else
Set DB = CurrentDb

DB.Execute ("INSERT INTO [Enrolment/Participant](EnrolmentID,
ParticipantID) VALUES (" & Me.EnrolmentID & ", " & Me.cmbPart & ");")
Set DB = Nothing
End If

Me.cmbPart = Null
Me.EnrolmentSubform.Requery
Me.cmbPart.SetFocus

--
 
J

Jesse Aviles

Check the record locking security level (options/Advanced) and make sure
that the All records is not checked (since you will have multiple users
editing the same table). I believe is best if you select the edited record.
If the edited record locking is selected, it appears that two different
users are adding a new record at the same time.
 
J

Jay Bukstein

I have the same problem also, and I've tried different
security settings and have had no success.
 
R

Richard

Hi

Thanks for your tip. The record locking is checked for the edit tab. And
sometimes only one person is using the form. Any ideas?

Thanks again

Richard
Jesse Aviles said:
Check the record locking security level (options/Advanced) and make sure
that the All records is not checked (since you will have multiple users
editing the same table). I believe is best if you select the edited record.
If the edited record locking is selected, it appears that two different
users are adding a new record at the same time.
--
Jesse Avilés
(e-mail address removed)
http://home.coqui.net/monk
Reply Only To The Newsgroup


Richard said:
Hi

I have been troubleshooting this form for weeks and still scratching my
head.

It is an enrolment form where when users click on the enrol button, the
EnrolmentId and ParticipantId is inserted into a one to many table,
Enrolment/Participant.

It works okay on the master, but ONLY somtimes when the users (mde) click,
an error msg "'The Microsoft Jet engin stopped the process because you and
anoth user are attempting to change the same data at the same time.'

I read a thread where it states that maybe a permission issue or another
instance is open. So, I assigned administer permissions to all users. The
users are still getting the error message and I'm stuck....

Many thanks in advance.

Richard


The code is onclick event of the enrol button.


Dim DB As dao.database

If IsNull(Me.cmbPart) Then
MsgBox "Please select name first!", , "WB"

Exit Sub

ElseIf Me.Dirty = True Then

Me.Dirty = False

Set DB = CurrentDb

DB.Execute ("INSERT INTO [Enrolment/Participant](EnrolmentID,
ParticipantID) VALUES (" & Me.EnrolmentID & ", " & Me.cmbPart & ");")
Set DB = Nothing
Else
Set DB = CurrentDb

DB.Execute ("INSERT INTO [Enrolment/Participant](EnrolmentID,
ParticipantID) VALUES (" & Me.EnrolmentID & ", " & Me.cmbPart & ");")
Set DB = Nothing
End If

Me.cmbPart = Null
Me.EnrolmentSubform.Requery
Me.cmbPart.SetFocus
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top