adhoustonj
Member
- Local time
- Today, 18:20
- Joined
- Sep 23, 2022
- Messages
- 195
Hello AWF,
I have a combobox that is reverting back to the old value when I edit it and I can not figure out why. I have a Not In List event that adds the record if it does not exist, but it is inconsistent with keeping the new value that was just edited, or reverting back to the original value, while the NEW value does get added to the table, the record just is not updated. I've tried to requery in after update event but that isn't helping.
In the example picture - I am trying to remove the last word 'engine' from the instruction.
Can anyone shine a light on this for me please?
EDIT: and to include an example of the edit/vs new working, in the picture below - I was trying to remove the last word 'engine'. If i were to add the word 'engine' so that the last two words of the combobox text said 'engine engine', it would work fine, and display immediately. What is the difference?
Not In List:
After Update:
I have a combobox that is reverting back to the old value when I edit it and I can not figure out why. I have a Not In List event that adds the record if it does not exist, but it is inconsistent with keeping the new value that was just edited, or reverting back to the original value, while the NEW value does get added to the table, the record just is not updated. I've tried to requery in after update event but that isn't helping.
In the example picture - I am trying to remove the last word 'engine' from the instruction.
Can anyone shine a light on this for me please?
EDIT: and to include an example of the edit/vs new working, in the picture below - I was trying to remove the last word 'engine'. If i were to add the word 'engine' so that the last two words of the combobox text said 'engine engine', it would work fine, and display immediately. What is the difference?
Not In List:
Code:
Private Sub spec_inst_NotInList(NewData As String, Response As Integer)
Call AddNewToList(NewData, "tblSpec_inst", _
"spec_inst", "Special Instructions", "")
Response = acDataErrAdded
End Sub
After Update:
Code:
Private Sub spec_inst_AfterUpdate()
Dim oldv As String, newv As String
If IsNull(Me.spec_inst.OldValue) Then
oldv = "blank"
Else
oldv = Me.spec_inst.OldValue
End If
If IsNull(Me.spec_inst) Then
newv = "blank"
Else
newv = Me.spec_inst
End If
If oldv <> newv Then
Call buaudit("tblTask", Me.task_id, "spec / key point", oldv, newv)
End If
'Me.spec_inst.Requery
End Sub
Attachments
Last edited: