SetValue expression not working

A

Alex

I have a macro with setvalue action:
Item: [Forms]![NewPartInputfrm]![Ref Part Weight lb]
Expression: IIf([Ref Part QTY]<0.0001,0,DLookUp("[FIN
WTLB]","ExcelARefParts","[Part#]=Forms![NewPartInputfrm].RefPart AND [As
Part#]=Forms![NewPartInputfrm].[Ref Part NHL] AND
[Model#]=Forms![NewPartInputfrm].[Model#]"))/[Ref Part Qty]

When running the macro from vba I get an action failed error, "does not
contain automation object 'Ref Part QTY'". I have an exact copy of this
macro I run from another vba sub which sets the value fine. Any idea why
it's not working? Thanks.
 
B

Barry Gilbert

I think you might need to fully qualify your reference to [Ref Part Qty] at
the end of the expression with the form that contains it like:
[Forms]![NewPartInputfrm]![Ref Part Qty]

Barry
 

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