ever saw this message??

alaric

Registered User.
Local time
Today, 16:19
Joined
Sep 6, 2004
Messages
50
Hi

Im using a chkbox on a form (the form is a popup based on a query) . to update the table I use following code.

Private Sub chkSelect_Click()
Dim strAfdanceId As Byte
strAfdansid = Me.txtdanceId

If Me.chkSelect.Value = -1 Then
DoCmd.RunSQL "UPDATE TAfdansen SET TAfdansen.[Selecteer] = True WHERE TAfdansen.[Afdansid] = " & strAfdansid & ""
DoCmd.RunCommand acCmdSaveRecord
DoCmd.Requery
End If
If Me.chkSelect.Value = 0 Then
DoCmd.RunSQL "UPDATE TAfdansen SET TAfdansen.[Selecteer] = False WHERE TAfdansen.[Afdansid] = " & strAfdansid & ""
DoCmd.RunCommand acCmdSaveRecord
DoCmd.Requery
End If

When I select the chkbox I get a write conflict message??? :confused:
see attachment

I think it has somthing to do that the query (source of the form) look at the same table I want to update?? is this correct??
if so...Does anybody knows how to get around this problem
thx
Al
 

Attachments

  • write conflict.JPG
    write conflict.JPG
    20.5 KB · Views: 102
1. I assume you have eliminated the possibility of the obvious multi user...

2. What line does debug stop on?

kh
 
You have two instances of the recordset in use on the form and have edited one of them. Remember the instances can be in RowSources, ControlSources, recordset objects, etc.
 
SJ McAbney said:
You have two instances of the recordset in use on the form and have edited one of them. Remember the instances can be in RowSources, ControlSources, recordset objects, etc.


oh yeah - good eye...

kh
 
thx for your quick response

it stops at:
DoCmd.RunCommand acCmdSaveRecord

I intended this db as single user. I didnt think of these possible problems.
Whats the best way to make it multi user?
I alrady have my App split into a seperate DB- and aplication part.

Al
 
I think sj isolated the problem - See it?

kh
 
help....i see the issue.... how to continue?

yes i see..
because the from is locking the record i get the message whil i try to change that record...hmmmmm

but.... maybe you know an other way to solve my problem.

as i mentioned,
the (pop-up) form is based on a query wich shows detail records of a student.
what I want is; select a record with a checkbox so its marked for printing. this chkbox is selected by the user.

Hope this can be done another way

Al
 

Users who are viewing this thread

Back
Top Bottom