Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Null value ????
Message
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Miscellaneous
Thread ID:
00046892
Message ID:
00047107
Views:
24
>>>I am using a form to copy an existing record to a new record and changing a value by
>>>increasing the value by 1 in one field.
>>>
>>>I am using insert and replace to accomplish this, however, when I run the code the value in
>>>the field is always changed to 2 instead of 1.
>>>
>>>I am copying the field to a variable and then using replace with variable + 1 to change the value.
>>>
>>>What am I doing wrong???
>>>
>>>Thanks and have a great day!
>>
>>is the value (existing record) already equal to 1?
>>if not, is this call being executed twice?
>
>That's what I thought at first, but when I check the dbf file it shows only one record being added.
>
>I'm thinking that the null value is being considered 1 and then the code adds another 1 to make 2.
>
>Each record has a job number ex. 7689 , what I'm doing is copying that record to a new record with
>a check digit of 01, 02 etc. 7689-01, 7689-02 to indicate how many forms were used for that job.
>
>how can I have vfp check the number of records for that particular number 7689 to calculate the
>check digit 01, 02 etc.?
>
>Or is there an easier way to accomplish the increment of 1 for each new record?
>
>Thanks

if the sequence is 7689, 7689-02.... check to make sure you aren't adding 1 to it twice (once before the insert, once w/ the replace)
vfp won't treat null (or 0) as a 1...
Previous
Reply
Map
View

Click here to load this message in the networking platform