G
Guest
Hi, im trying to loop through a list of form controls to determine what has
been changed, now im completley lost here so if someone can point out where
im going wrong id appreciate it.. thanks in advance
Dim frm As Form
Set frm = Forms!main
Dim ctrl As Object
ctrla = Array("ppm_omr", "ppm_lmr", "ppm_oillc", "ppm_oildc", "ppm_ib_irm",
"ppm_ib_id", "ppm_ob_irm", "ppm_ob_id" _
, "ppm_monthly1", "ppm_monthly2", "ppm_monthly3", "ppm_monthly4",
"ppm_monthly5", "ppm_monthly6" _
, "ppm_bmonthly1", "ppm_bmonthly2", "ppm_bmonthly3", "ppm_bmonthly4",
"ppm_bmonthly5", "ppm_bmonthly6" _
, "ppm_quarterly1", "ppm_quarterly2", "ppm_quarterly3", "ppm_quarterly4",
"ppm_quarterly5", "ppm_quarterly6" _
, "ppmx_lampsize", "ppmx_installed", "ppmx_installedmeter", "ppmx_serial")
For Each varitem In ctrla
Set ctrl = varitem
If (frm!ctrl.OldValue <> frm!ctrl.Value) Then
MsgBox varitem & "is differant"
End If
Next varitem
im trying to use the value of an array as the control name on a form, i keep
getting an error saying access cant find the field varitem
been changed, now im completley lost here so if someone can point out where
im going wrong id appreciate it.. thanks in advance
Dim frm As Form
Set frm = Forms!main
Dim ctrl As Object
ctrla = Array("ppm_omr", "ppm_lmr", "ppm_oillc", "ppm_oildc", "ppm_ib_irm",
"ppm_ib_id", "ppm_ob_irm", "ppm_ob_id" _
, "ppm_monthly1", "ppm_monthly2", "ppm_monthly3", "ppm_monthly4",
"ppm_monthly5", "ppm_monthly6" _
, "ppm_bmonthly1", "ppm_bmonthly2", "ppm_bmonthly3", "ppm_bmonthly4",
"ppm_bmonthly5", "ppm_bmonthly6" _
, "ppm_quarterly1", "ppm_quarterly2", "ppm_quarterly3", "ppm_quarterly4",
"ppm_quarterly5", "ppm_quarterly6" _
, "ppmx_lampsize", "ppmx_installed", "ppmx_installedmeter", "ppmx_serial")
For Each varitem In ctrla
Set ctrl = varitem
If (frm!ctrl.OldValue <> frm!ctrl.Value) Then
MsgBox varitem & "is differant"
End If
Next varitem
im trying to use the value of an array as the control name on a form, i keep
getting an error saying access cant find the field varitem