update checkbox on one form with info from another

G

Guest

Is there some sort of code where when after updating a certain field on one
form it will automatically update a checkbox to true on another form?

Right now I have a Purchase Order form (frmPurchaseOrders) that has a
combobox named "cboChargedTo". What I want it do is once I update the info
in "cboChargedTo" (only if the user chooses G/L Code 00-1143) I want a
checkbox (called Inv2006) on another form "frmPartsDetail" to automatically
be True. I know I need an Event Procedure in the AfterUpdate property of
"cboChargedTo" but so far have I've not been able to get the correct coding
to make this work properly.

This is what I have right now:

Private Sub cboChargedTo_AfterUpdate()
Select Case Me.cboChargedTo

Case Is = "00-1143"
Me!Forms![frmPartsDetail].[Inv2006] = True

End Select

End Sub

Can anyone tell me what it is that I've done wrong here?
Any help would be greatly appreciated.

Thanks Kindly
 
G

Gina via AccessMonster.com

Have you stepped through your code to see if it is getting to the line where
you set the check box to true?

Gina

Gabby said:
Is there some sort of code where when after updating a certain field on one
form it will automatically update a checkbox to true on another form?

Right now I have a Purchase Order form (frmPurchaseOrders) that has a
combobox named "cboChargedTo". What I want it do is once I update the info
in "cboChargedTo" (only if the user chooses G/L Code 00-1143) I want a
checkbox (called Inv2006) on another form "frmPartsDetail" to automatically
be True. I know I need an Event Procedure in the AfterUpdate property of
"cboChargedTo" but so far have I've not been able to get the correct coding
to make this work properly.

This is what I have right now:

Private Sub cboChargedTo_AfterUpdate()
Select Case Me.cboChargedTo

Case Is = "00-1143"
Me!Forms![frmPartsDetail].[Inv2006] = True

End Select

End Sub

Can anyone tell me what it is that I've done wrong here?
Any help would be greatly appreciated.

Thanks Kindly
 
G

Guest

Hi Gina,

Thank you for your quick reply. You'll have to excuse me though cause I'm a
newbie when it comes to code. Can you explain "stepping through your code"
to me.

Thanks


Gina via AccessMonster.com said:
Have you stepped through your code to see if it is getting to the line where
you set the check box to true?

Gina

Gabby said:
Is there some sort of code where when after updating a certain field on one
form it will automatically update a checkbox to true on another form?

Right now I have a Purchase Order form (frmPurchaseOrders) that has a
combobox named "cboChargedTo". What I want it do is once I update the info
in "cboChargedTo" (only if the user chooses G/L Code 00-1143) I want a
checkbox (called Inv2006) on another form "frmPartsDetail" to automatically
be True. I know I need an Event Procedure in the AfterUpdate property of
"cboChargedTo" but so far have I've not been able to get the correct coding
to make this work properly.

This is what I have right now:

Private Sub cboChargedTo_AfterUpdate()
Select Case Me.cboChargedTo

Case Is = "00-1143"
Me!Forms![frmPartsDetail].[Inv2006] = True

End Select

End Sub

Can anyone tell me what it is that I've done wrong here?
Any help would be greatly appreciated.

Thanks Kindly
 
F

fredg

Is there some sort of code where when after updating a certain field on one
form it will automatically update a checkbox to true on another form?

Right now I have a Purchase Order form (frmPurchaseOrders) that has a
combobox named "cboChargedTo". What I want it do is once I update the info
in "cboChargedTo" (only if the user chooses G/L Code 00-1143) I want a
checkbox (called Inv2006) on another form "frmPartsDetail" to automatically
be True. I know I need an Event Procedure in the AfterUpdate property of
"cboChargedTo" but so far have I've not been able to get the correct coding
to make this work properly.

This is what I have right now:

Private Sub cboChargedTo_AfterUpdate()
Select Case Me.cboChargedTo

Case Is = "00-1143"
Me!Forms![frmPartsDetail].[Inv2006] = True

End Select

End Sub

Can anyone tell me what it is that I've done wrong here?
Any help would be greatly appreciated.

Thanks Kindly

Both forms must be open at the same time.
The bound column of the combo box is this column.
I'll guess that there is more to this code than just the one Select
Case shown. What do you want to do if "00-1143" is not selected?

Private Sub cboChargedTo_AfterUpdate()

Select Case Me!cboChargedTo
Case Is = "00-1143"
Forms![frmPartsDetail]![Inv2006] = -1
End Select

End Sub
 
G

Guest

Hi Fred,

Thank you so much for your help. It worked like a charm. And yes you're
right, there should've been another Select Case statement that I forgot and
should've said "if not 00-1143 than Inv2006 should be false.

Again Thank you so much.
Rgds

fredg said:
Is there some sort of code where when after updating a certain field on one
form it will automatically update a checkbox to true on another form?

Right now I have a Purchase Order form (frmPurchaseOrders) that has a
combobox named "cboChargedTo". What I want it do is once I update the info
in "cboChargedTo" (only if the user chooses G/L Code 00-1143) I want a
checkbox (called Inv2006) on another form "frmPartsDetail" to automatically
be True. I know I need an Event Procedure in the AfterUpdate property of
"cboChargedTo" but so far have I've not been able to get the correct coding
to make this work properly.

This is what I have right now:

Private Sub cboChargedTo_AfterUpdate()
Select Case Me.cboChargedTo

Case Is = "00-1143"
Me!Forms![frmPartsDetail].[Inv2006] = True

End Select

End Sub

Can anyone tell me what it is that I've done wrong here?
Any help would be greatly appreciated.

Thanks Kindly

Both forms must be open at the same time.
The bound column of the combo box is this column.
I'll guess that there is more to this code than just the one Select
Case shown. What do you want to do if "00-1143" is not selected?

Private Sub cboChargedTo_AfterUpdate()

Select Case Me!cboChargedTo
Case Is = "00-1143"
Forms![frmPartsDetail]![Inv2006] = -1
End Select

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top