checkbox updating a table fieldvalue... but not correctly (1 Viewer)

bulbisi

Registered User.
Local time
Today, 10:42
Joined
Jan 20, 2011
Messages
51
Well, I had some difficulties to choose the right forum zone. Because it is most probably a VBA solution attached to that form problem.

Here we go:
I have a form (jpg attached) with checkboxes, When clicking these, it runs automatically a VBA function in order to update the value of the related Table field.
Code:
Private Sub ManualPmt_AfterUpdate()
Dim update As String
DoCmd.SetWarnings False
With Me
                If ![ManualPmt] = True Then
    update = "UPDATE T_source_M_payments_contracts SET PAYMETH = 'Manual' WHERE ManualPmt = True"
                   End If
                If ![ManualPmt] = False Then
    update = "UPDATE T_source_M_payments_contracts SET PAYMETH = '' WHERE ManualPmt = False"
                   End If
End With
DoCmd.RunSQL update
DoCmd.SetWarnings True
Me.Refresh
End Sub
It works fine.... but not for the very last checkbox clicked. It sounds like it remained in an Edit mode or something, and then cannot be updated in the table.
And so cannot be updated in the form textbox either! (see again my jpg attached)
Anyone a solution?
I tried to "move" the selection to another checkbox or form field using me!xxx.setfocus in VBA but it doesn't change anything.
Thanks in advance
Chris
 

Attachments

  • Manual-defect selection edit mode.jpg
    Manual-defect selection edit mode.jpg
    75.4 KB · Views: 218

bulbisi

Registered User.
Local time
Today, 10:42
Joined
Jan 20, 2011
Messages
51
SOLVED
I was busy trying to update straight in the table whil a simple update in the form field was doing the job perfectly.

I should thanks myself here but unfortunately, I can't :)
 

Users who are viewing this thread

Top Bottom