syntax for field variable

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
 
A

Allen Browne

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

John

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top