Could a Lantican or a user please clarify on the proper syntax to use with this code regarding form!field
A shy forum member had a problem using this code and I volunteered to check it out (they may be sorry I offered to help)
They have a file structure that looks like this
NewSesame Forms Add Data Customer Data Form1 Form2 Invoices Inv Data Prod Prod This worked fine to generate there customer number
If cusnum = "" Then cusnum = @Tonumber(@XLookupR(@Fn, 999999, "cusnum", "cusnum")) + 1
However this would not work to generate an invoice number
If InvNum = "" Then InvNum = @Tonumber(@XLookupR(@Fn, 999999, "InvNum", "InvNum")) + 1
By adding the form name like this it now works
If InvNum = "" Then InvNum = @Tonumber(@XLookupR(@Fn, 999999, "inv data!InvNum", "InvNum")) + 1
But I can not explain to them how to get the next level to work. We tried
If ProdNum = "" Then InvNum = @Tonumber(@XLookupR(@Fn, 999999, "prodNum", "prodNum")) + 1
and then
If ProdNum = "" Then InvNum = @Tonumber(@XLookupR(@Fn, 999999, "prod!prodNum", "prodNum")) + 1
and then
If ProdNum = "" Then InvNum = @Tonumber(@XLookupR(@Fn, 999999, "prod!prod!prodNum", "prodNum")) + 1
So basically I am asking what is the rule of thumb to follow with this logic and form names. Or were have we gone wrong.
Thanks All.
|