If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register or Login
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

VB6 edit a record

Hi, I've created a program to be used in a school to monitor the stock of equipment. a student is able to loan stock out, which should as a result drop the ammount of stock by 1 and increase a tally of the total loans for that piece of stock by 1. The coding works to the point that the stock drops, however all of the information writes back to a .text files, yet it isnt updating within the file.

Re: VB6 edit a record

I do not see any issue with the piece of code that reads and writes the file.
You say that all the info writes back to the file but it doesn't update the file. That would not seem possible and how would you know? If the file has not changed then there would be no difference after the write so how would you tell?

I would say step through the code and see what is happening at runtime.

One note about the code is that it would appear that you are only trying to update one item in which case you should exit the loop once it has been found rather than continue to cycle through the rest of the file

Code:

If product.ProductID = ProductID AND found=false Then

As for the second piece of code that may very well cause an issue. You should use the Product class rather than a single var there.