Originally Posted by
June7
I tested code and works for me. If you want to provide db for analysis, follow instructions at bottom of my post.
Hi,
Thanks for your reply. The code doesn't for me, I am trying to attach the file via your instructions but it says my zip file is too big, it is 1.7mb and it says the limit is 500kb. I've uploaded it here for now: https://gofile.io/?c=yvDBvA. Confidential data has been removed.
What I am trying to do is, on the main CRM form, there are two fields, IL1 Code and IL2 Code. Whenever this data is changed or updated, I want it to update the field Publisher IL1 and Publisher IL2 in the subform Publisher Info. I also want IL1 Code and IL2 Code on the main form, to update Item Level 1 Code and Item Level 2 Code on the subform called Control File.
I am aware that Item Level 2 Code is duplicated on Control File, this is because it needs to get created in separate places on our bespoke system, so this final tab, is like a check list to ensure things are done.
As previously mentioned, I've setup the text boxes to have a control source, taken from the main form:
Code:
=[Forms]![frm_Publisher_Setup]![IL1_Code]
And in VBA, I have this, in the AfterUpdate section:
Code:
Private Sub IL1_Code_AfterUpdate()
With Me.frm_Publishing_Info_Subform.Form !Publisher_IL1 = Me.IL1_Code
.Dirty = False
End With
End Sub
Which I changed to this:
Code:
Private Sub IL1_Code_AfterUpdate()
With Me.frm_Publishing_Info_Subform.Form
!Publisher_IL1 = Me.IL1_Code
.Dirty = False
End With
With Me.frm_BookMaster_Control_Files_Subform.Form
!New_IL1_Code = Me.IL1_Code
.Dirty = False
End With
End Sub
When I change the text box in the main form, I get the following error:
Code:
Run-time error: 2448
You can't assign a value to this object.
I then have this highlighted in error in yellow:
Code:
!New_IL1_Code = Me.IL1_Code
I have set the field New_IL1_Code to Enabled = False as I don't want the user to be able to change the data. I want the data to be displayed and that's it.
Let me know if you require any further information.