Sorry Bob, I should have started a new topic for my question rather than jumping into yours.
In another thread, I said:
Quote: I have a button that assigns a code to a record much the way your "Record=" code does. However, mine reads
vNextNum = @ToNumber(@XLookupR(@FN, "99999999", "Code", "Code")) + 1
I notice that my 99999999 is in quotes but yours is not. Is there a difference in performance? Is one preferred over the other? What would be the conditions that would require one method over the other?
To which Bob replied:
Quote: Sample was provided for sample of syntax highlighting, not for code sample. Section was taken randomly to show many different highlight features.
Are quotes better in position two, the "key" code? I am not sure. The Sesame Programming Guidel shows no quotes on page 39. The sample shown was looking for a number in a number field. Is yours looking for a number in a text field?
Mine is a number field. I have no idea why my "99999999" is in quotes, but the button seems to work (looks up the last saved customer code and increases the code by one). I'm not fully comfortable with the XLookup commands and must have had help with this one, so perhaps I wrote it wrong in the process. I'll take the quotes out if they shouldn't be there, or if it will work better without them. I hope someone reading this can give some advice, and in the meantime I'll experiment.
One thing I wonder about...if I have multiple users accessing this database and adding customer records, is duplication of codes possible if one of them pushes the "Assign Code" button but delays saving the record until after another user has done the same thing? If so I'll need to figure out a way to check for a unique value when saving. Currently my programming doesn't do this.
Back to the Forum archives! I'm sure this has been discussed before.