By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
464,660 Members | 1,302 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 464,660 IT Pros & Developers. It's quick & easy.

Checkbox after Update event

P: 5
I am new to access and need some help with coding.
I have a main form XYZ with 2 subforms. I have a checkbox on subform1 "frmExpediteS" that when checked i would like the Value in Feild "PO" of this subform to appear & populate the feild "PO" in a second subform 2 "frmExpediteDetails". 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
May 25 '07 #1
Share this Question
Share on Google+
4 Replies

puppydogbuddy
Expert 100+
P: 1,923
I am new to access and need some help with coding.
I have a main form XYZ with 2 subforms. I have a checkbox on subform1 "frmExpediteS" that when checked i would like the Value in Feild "PO" of this subform to appear & populate the feild "PO" in a second subform 2 "frmExpediteDetails". 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
Try this:

The following assumes that both subforms are direct subs of the main form (subform2 is not sub of subform1). Both subforms have to be opened (but do not have to be visible) in order for this to work.

Expand|Select|Wrap|Line Numbers
  1. Private Sub YourCheckbox_AfterUpdate()
  2.    Forms!frmXYZ!frmExpediteDetails.Form!PO.Value = Forms!frmXYZ!frmExpediteS.Form!PO.Value
  3. End Sub
May 25 '07 #2

P: 5
Thanks Buddy I will give it a go
May 25 '07 #3

P: 5
Hi Buddy,
I tried your code & I get a synteax error message.

Expand|Select|Wrap|Line Numbers
  1. Private Sub Expedite_AfterUpdate()
  2.  
  3. Forms!frmExpedite!frmExpediteDetails.Form!PO.Value = Forms!frmExpedite!frmExpediteS.Form!PO.Value
  4.  
  5. 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"

Tks again for any help


And Yes your right this is how the form is set up.

"The following assumes that both subforms are direct subs of the main form (subform2 is not sub of subform1). Both subforms have to be opened (but do not have to be visible) in order for this to work"
May 26 '07 #4

P: 5
Thanks for help but its working now, with a lot of help,
the code is
Expand|Select|Wrap|Line Numbers
  1. Private Sub Expedite_AfterUpdate()
  2. Dim Clone As DAO.Recordset
  3.    If Me![Expedite] Then
  4.       Set Clone = Forms!frmExpedite!frmExpediteDetails.Form.RecordsetClone
  5.       With Clone
  6.          .AddNew
  7.          !PO = Me![PO]
  8.          .Update
  9.       End With
  10.    End If
  11.  
  12. End Sub
  13.  
May 26 '07 #5

Post your reply

Sign in to post your reply or Sign up for a free account.