Set Control value on a form

  • Thread starter Thread starter MeSteve
  • Start date Start date
Forms!frmYourForm!txtYourControl.Value = "Some Value"
The form must be open and txtYourControl must be updateable.
 
This is what I needed to move the logic to a module. I had already started
tinkering with that, but couldn't get the control on the report to update. I
will try this tomorrow, thanks.
 
I am a little confused since this is a report forum and your most recent
reply states "control on the report to update" but your initial question
included "set the value of control on a form".

It would help if you provided some context regarding what you are attempting
to do.
 
Oops, good catch. I am trying to calculate the value of a control on a
REPORT using VBA instead of the 'too deeply nested' code posted in another
thread.
 
I would write or call the code from the On Format event of the report section
that contains the control.
 
Thanks. Yeah, using code was the only way I could get around the Error#
showing up because there was no record that matched my 'query'.

Why OnFormat?
 
You could try either the On Format or the On Print of the section. I'm not
sure if the control would grow or shrink if you set the value in the On Print
event.
 
Back
Top