Checkbox after Update event (1 Viewer)

roccoau

Registered User.
Local time
Tomorrow, 04:53
Joined
Sep 1, 2006
Messages
56
I have a checkbox on a subform XYZ that when checked i would like the Value in Feild A of this subform to appear in Feild B in a second subform ABC. I think I need an after Update event but not sure of the code to use.
Can someone please steer me in the right direction.

Tks
 

roccoau

Registered User.
Local time
Tomorrow, 04:53
Joined
Sep 1, 2006
Messages
56
Thanks Ray for help.
I had a look at your site but am still having trouble, I don't think I understand how it work full being new to Access.

I came up with below code but it does not work.

Private Sub expedite_AfterUpdate()
Forms Me.frmExpediteS.frmExpediteDetails.Form.PO = Me.PO
End Sub

Where am I going wrong.

The main form is "frmexpedite"
Subform 1 is "frmExpediteS" Feild name to copy from "PO"
Subform 2 is "frmExpediteDetails" Feild to copy To "PO"

I have attached a sample
Tks again for any help
 

Attachments

  • Sample.zip
    180.9 KB · Views: 175

Dreamweaver

Well-known member
Local time
Today, 20:23
Joined
Nov 28, 2005
Messages
2,466
Replace your on click event with this

Code:
Private Sub Expedite_AfterUpdate()
Dim Clone As DAO.Recordset
If Me![Expedite] Then
Set Clone = Forms!frmExpedite!frmExpediteDetails.Form.RecordsetClone
With Clone
    .AddNew
    !PO = Me![PO]
    .Update
End With
End If
Forms![frmExpedite]![frmExpediteDetails].SetFocus ' YOU CAN REMOVE THIS 'LINE IF YOU WANT THE FOCUS TO STAY ON MAIN FORM
End Sub
 

roccoau

Registered User.
Local time
Tomorrow, 04:53
Joined
Sep 1, 2006
Messages
56
Dreamweaver, thanks that works great, exactly what I wanted it to do.
And thanks Ray for your imput as well.
 
Last edited:

Users who are viewing this thread

Top Bottom