syntax for field variable

  • Thread starter Thread starter John
  • Start date Start date
J

John

Can someone please point me in the right direction? I need to substitute a
variable into the following expression.

If IsNull(Forms![Hire Input]![**field name as variable here***].Value)
Then Me!ActiveXCtl1.Value = Date

I could do it through string concatenation

If IsNull(strConcatenated) etc.

but I'm sure there's an easy way and looking this up seemed to draw a blank.
(should I be using the object structure instead? The form containing this
refers to another hidden form.)

Thanks
 
Assuming the field/control name is in a string variable named strField:
Forms![Hire Input](strField)
 
Many thanks Allen...just the job!

Allen Browne said:
Assuming the field/control name is in a string variable named strField:
Forms![Hire Input](strField)

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

John said:
Can someone please point me in the right direction? I need to substitute a
variable into the following expression.

If IsNull(Forms![Hire Input]![**field name as variable here***].Value)
Then Me!ActiveXCtl1.Value = Date

I could do it through string concatenation

If IsNull(strConcatenated) etc.

but I'm sure there's an easy way and looking this up seemed to draw a blank.
(should I be using the object structure instead? The form containing this
refers to another hidden form.)

Thanks
 
Back
Top