Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
ecolomer
Master II
Master II

Macro don't work properly

I have a macro that works well in a QV file but not in other.

The macro in question is:

sub InLote

  SelVal=ActiveDocument.Evaluate("=getFieldSelections(NumPedido, ';', 25)")

  NReg=ActiveDocument.Evaluate("=getSelectedCount(NumPedido)")

  for k = 1 to NReg

     InValue = ActiveDocument.Evaluate("=Subfield(SelVal, ';' ,"&k&")")

      ActiveDocument.GetApplication.Sleep 100

      ActiveDocument.DynamicUpdateCommand("UPDATE LOTE SET LoteFab=$(vLote) WHERE NumPedido="&InValue&"")

      ActiveDocument.GetApplication.Sleep 100

  next

end sub

The statement that it is not running: is marked in blod. But in other QV the same statement work's perfectly

Any help

TX

12 Replies
ecolomer
Master II
Master II
Author

yes, it is true, but does not work

I do not understand, because your file worked perfectly and I see where I was wrong. I am furious with myself.

Thank you for all the help you are giving me.

ecolomer
Master II
Master II
Author

YA ESTÁ !!!!!!

That is ok, now.

Is a ' diferent

I'm sorry to disturb you, and many thank's for all

jerem1234
Specialist II
Specialist II

You're welcome! I've had plenty of times when something so simple had me stumped for awhile(just like a wrong quote), so i feel your pain!

Glad I could help!