Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Program blocking "SaveRecord"

Status
Not open for further replies.

fheyn

Programmer
Mar 22, 2001
198
DE
Now I've been working on this probelm for about 3 hours and can't find out how to solve it (ACCESS 2000) :
A table contains a field which holds the information that
this record is terminated and won't allow any changes being
saved to database.
problem 1 : I don't see how this field interacts with the
database and/or table but all the records which have this field set are blocked from being saved.
problem 2 : on creating a new record with the current record
being a "terminated" one, somehow the new record can't be saved too:
DoCmd.RunCommand acCmdSaveRecord
will give an error-message saying "service currently not
available" (very "free" translation).
Anyone out there has an idea this can be set or manipulated.
Any suggestions welcome.
thanks in advance
 
The error probably says Save Command currently not available and it probably means a process has locked the system. Probably not a news flash for you but what's probably happening is that some code is running behind the scene that's causing the headaches. What type of field holds the information about locking the record. Also, what code do they use to lock the record.

Paul
 
Hi Paul,
thanks for the response.
it's like this :
the field is a yes/no field.
record-locking I havn't found.
On startup always the LAST record is read and shown.
What I do now is jump to the FIRST record (whose data cannot
be edited and cannot be saved) :

Private Sub cmdFirst_Click()
On Error Resume Next
DoCmd.GoToRecord , , acFirst
End Sub

then I ceate new record :

Private Sub cmdNew_Click()
Dim s As String

If Me.grfFinished.BackColor = ColorGreen Then
(A) DoCmd.RunCommand acCmdSaveRecord
End If

DoCmd.RunCommand acCmdRecordsGoToNew

Me.OfflineNo = "-"
Me.OfflineNo = GetNewOfflineNo(Me.AutoID)

Call GetPageOneDefault

(B) DoCmd.RunCommand acCmdSaveRecord

Form_Current
End Sub

and it gives me the error message in (B).

First I had the error in (A) and if ... endif solved this,
but (B) must be executed because it already corresponds to
the new record.



 
You could try moving the code to before the Call GetPageOneDefault line or maybe even after the command to go to a new record, or you can tell me what the Call is doing. What's probably happening is the code has probably locked the record (it locks it while it's executing) and the save record command can get past that lock.

Paul
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top