I have written a simple VBA to change font size due to space limitation of a bounded field [PACKTERMS] which I control by a group option viz. [ShrinkPkg]. The default value of [ShrinkPkg] in table is 1.
I have bounded [ShrinkPkg] with impression that [PACKTERMS] can be controlled independently by [ShrinkPkg]. Below is the code written:
Private Sub ShrinkPkg_AfterUpdate()
DoCmd.DoMenuItem acFormBar, acRecordsMenu, 5, , acMenuVer70
If ShrinkPkg.Value = 1 Then
Me.PACKTERMS.FontSize = "8"
ElseIf Me.ShrinkPkg.Value = 2 Then
Me.PACKTERMS.FontSize = "7"
ElseIf Me.ShrinkPkg.Value = 3 Then
Me.PACKTERMS.FontSize = "6.5"
End If
End Sub
=====
My problem with the above is the control of fontsize of all the records which will automatically change upon each AfterUpdate. I want [PACKTERMS] of every row of record to have fontsize 8, but if option 2 or 3 is selected,
only that particular record will be affected, or else return to default value of 1 or size 8. However, this is not the case as afterupdate of 1 record to option 2 or 3 will change all records, even new row of record to the selected option.
Can anyone help me to finetune the code ?
Thanks for any help render.
Regards
Kiang