March 10th, 2003, 07:24 AM
Finished something but cant search it
Ive included something ive been working on, its a cencus return form
Ive commented it where i can so hopefully easy to follow
It uses an index file for the 9 pointer values
Ive got it to read / write to the files it needs to
Now all im trying to do is add a search option
So if someone has the three option boxes set to who they want to search for and click 'search' im trying to get it to perform the search and return the results in the txt box next to it
Hope someone can help, if its easier i can paste the code of the form in here,
Thanks alot everyone
March 10th, 2003, 10:22 PM
Ok, I did a little playing around with your program. I didn't understand what you were doing with the index bytes. They just seem to be a random assignment since they are reassigned each time the form is closed and is in other places.
I did some re-writing to the program but it does what you want it to. You may want to play with it some, since I didn't do a lot of performance and error handling tweaking in it, but it works.
It will add, search, and refill the text boxes on a search that is double-clicked.
Maybe it is what you were wanting.
March 11th, 2003, 02:55 AM
Im looking at what youve done and it looks all good
But when i try and save a record this line produces an error:
strSegments = Split(strRecord, "|") 'explode the string into segments
The error i get is a Compile Error (Sub or function not defined)
(which it highlights the 'Split' word on occurance)
Many thanks for your help
[Edit: Alot of lines seemed to be commented when they look like they shoudnt be, is this correct? ]
Last edited by Battery Powered; March 11th, 2003 at 02:59 AM.
March 11th, 2003, 07:59 AM
What service pack are you running for vb? If you don't have the latest, I would recommend that you get that one.
Yes, the lines that are commented out are there for a reason. In some cases I didn't see the relevance, it others they weren't necessary. For the most part what is commented out is the index byte sections. I really don't understand quite what you are doing here since you couldn't reverse the data to get the information from it with the manner that you were doing so I commented it out and re-wrote it in a way that you could easily reverse it.
The Split function is part of the vb language so I would check your service pack to make sure. I didn't alter your project properties at all so it should work correctly. I have service pack 5 installed.
March 11th, 2003, 08:06 AM
The challenge set to me was to use an index file, and in that file have a pointer for the last record for that group
So that by looking in the index file would show you the last record, and then that record would show you the one before that one and so on
If that makes any sense : )
March 11th, 2003, 08:21 AM
Ok, that makes sense enought, but here is the thing. The index file should be associated with the record sequence number, not the cencus record data values. This way you can retrieve the data and actually decifer it. Your original method would not allow for this. All you need to do now is as the record is being written, write to the index file it's sequence number, then you have an account of what records were put in, although it will still just be a running number. This also allows you to change one of the functions to make it quicker in the long run. The function that retrieves the record count could be changed to look that the index file and increment the last number it retrieves and that should be the next sequence number used.
Also, if this is homework, then I suggest that you go to your instructor and/or classmates for help before coming to this forum.
March 11th, 2003, 08:34 AM
Yes I am a student, but this is not college related
and i dont have these services packs you mentioned so im gonna update myself and see where it takes me : )