save randomly

adaniele

Registered User.
Local time
Today, 23:44
Joined
Jul 18, 2005
Messages
176
guys, here is my problem.
I created a tool to manage changes. As part of the process a support can edit a change to change the status and the requester can validate that the change is done properly. Both processes work in the same way, the diference is that the can modify different fields in the form. But here is the procedure.
Edit a task (support role): From a task management menu press the button to open a form with a list of changes to be done. Double clicking in a specific change number a new form with the change detail is opened. When the support finishs press the save button and insert the changes in a history table (to track the changes) and update the change table to update the record. Until this point everything is great.
Validate a task: (requester role): from the task management menu press a button to open a form with a list of changes to be validated. Double clicking in a specific change number a new form with the change detail is opened. When the requester finishs press the save button and save the changes in a history table (to track the changes) and the change table to update the record.

The problem is that the validate task form doesnt update the change table and doesnt insert all the fields in the history table, only some of them.

Here is the error msg:
" ILI index tool can't update all the records in the update query.
ILI index tool did not update 0 fields due to a type conversion failure, 0 records due to the key violations,1 records due to the lock violations, and 0 records due to the violation rule violations.
Do you want to continue running this type of action query anyway?
to ignore the errors and run the query, click yes.
for an explanation of the causes of the violations, click help"

Here are the sql to update and insert once the save button is pressed:
Code:
Public Sub grabarstatus()
        'DoCmd.SetWarnings False
        MsgBox "entered"
        DoCmd.RunSQL "insert into [history] (change_id,before,after,user,modify,action) values (" & Me.Task_Num.Value & ",'" & vstatus & "','" & Me.status.Value & "','" & Forms!Login!username1 & "','" & Now() & "','Validate status');"
        DoCmd.RunSQL "update [newchange] set status='" & Me.status.Value & "' where change_id=" & Me.Task_Num.Value & ";"
        DoCmd.SetWarnings True
End Sub

thx very much
 
it is back.........grrrrrrrr.
here is more info.
When both forms are loaded, all the fields are populated with a dlookup, using the number specified in the previous list.
To save the new data i am using the above code and it works for the editing form but it doesnt for the validate form. However, in the validate form , the code works for the history table but not for the newchange table.
All the values in the form are correct.
 
i solved the problem. i created a copy from the form which works and modified what i needed.
thx.
 
Last edited:

Users who are viewing this thread

Back
Top Bottom