hollstar
asked on
Open & Save 2 Dimensional Array
Hello All Experts :
OK – All I need help with is saving the data I have in a Two-Dimensional Array, and then of course bringing
it back from the file. I have made the forms, buttons etc, etc, and I think (but have not fully tested)
my array works fine.
The bottom line is, when the user gets to the last page (Page 2) of the survey, they hit next response
to go to a new one. Or, previous should they need to go back. The maximum number is 500.
When they are done, they need to hit finish, and a message box must confirm that they want to save the
result. When this happens, a common dialog should appear asking for a file name. (Text File Format,
Comma Delimited)
For Open – Common Dialogue should appear asking the user to select a file. The data is loaded into the
array, and the user should then see the results starting at Page One, Result One. Should the user make
ANY changes, this must be noted, and when the program exits, it MUST be confirmed that changes have
been made and if the users wants to update the file.
I have made a basic outline of the file in the results directory.
So you can work with my project, I have uploaded it to the net for anyone to download. If your not happy
with the way I have coded something (considering I’m a newbie) please feel free to change it.
http://www.hypermax.net.au/~user/hollstar/vbec3.zip
This program is for an assignment I’m working on and is not for public use.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
hollstar, didn't test it enough obviously. Here is the necessary mod:
Private Function GetRow(ByVal Element As Integer) As String
Dim strRow As String
Dim intElement As Integer
For intElement = 0 To 7
strRow = strRow & mvarQuestions(Element, intElement) & IIf(intElement = 7, "", ",")
Next
GetRow = strRow
End Function
Also I think you need to change the SaveFile sub to have .ShowSave instead of .ShowOpen - my fault I copied from the openfile bit and forgot to change the dialog type.
Private Function GetRow(ByVal Element As Integer) As String
Dim strRow As String
Dim intElement As Integer
For intElement = 0 To 7
strRow = strRow & mvarQuestions(Element, intElement) & IIf(intElement = 7, "", ",")
Next
GetRow = strRow
End Function
Also I think you need to change the SaveFile sub to have .ShowSave instead of .ShowOpen - my fault I copied from the openfile bit and forgot to change the dialog type.
ASKER
Yeppa - Checked That Out...
Only thing is, with my loading code for the information itself, it doesnt display the info for the first page, and it will also get an error for the new page after the last one in the file...
Could you offer any error trapping for this ?
Only thing is, with my loading code for the information itself, it doesnt display the info for the first page, and it will also get an error for the new page after the last one in the file...
Could you offer any error trapping for this ?
ASKER
OK - I fixed a few of the problems but I still have not had a good chance to look into the following hence any ideas would be good...
When you load up a file, it does not display the data... You have to go next and then back to see it...
And also, you get an error when you reach the end of the file.
One other option I would like to include in this is to allow the user to go the first,last & search for a result... Could you help with this ? If so please do so... Should you want a further 50 points or so, this is not a problem.
When you load up a file, it does not display the data... You have to go next and then back to see it...
And also, you get an error when you reach the end of the file.
One other option I would like to include in this is to allow the user to go the first,last & search for a result... Could you help with this ? If so please do so... Should you want a further 50 points or so, this is not a problem.
ASKER
TimCottee :
While your code worked in the main ways I required, I felt that (assuming you have been available to make further posts) you have been unwilling to make further contributions towards my question due to the few extra questions I asked in relation to this question as well as fixing other small bugs.
Because I am no expert, by any stretch of the imagination, it has taken me until now, (on and off) to fix any problems I have had to a (I hope) satisfactory level. While I am awarding you the points, I am only offering a “B” result for the above fact. Please understand I’m sure you are very busy, as am I, however I do feel that if you think you can not follow up on a question you answer, then don’t offer one.
Anyway, hope to see you around EE more often… I know I will need it ! ;)
Hollstar
While your code worked in the main ways I required, I felt that (assuming you have been available to make further posts) you have been unwilling to make further contributions towards my question due to the few extra questions I asked in relation to this question as well as fixing other small bugs.
Because I am no expert, by any stretch of the imagination, it has taken me until now, (on and off) to fix any problems I have had to a (I hope) satisfactory level. While I am awarding you the points, I am only offering a “B” result for the above fact. Please understand I’m sure you are very busy, as am I, however I do feel that if you think you can not follow up on a question you answer, then don’t offer one.
Anyway, hope to see you around EE more often… I know I will need it ! ;)
Hollstar
My apologies Hollstar, sometimes I don't have as much time as I would like to keep up to date on my active threads, I currently have approx 1000 threads in 4 different forums open so occasionally things like this slip through the net. I am not one of these experts that absolutely have to have an 'A' grade though I appreciate them. I am glad that you managed to iron out the quirks for yourself and would be happy to help in the future should I see another question from you.
ASKER
Also, when it saves, it should be a text file, buttom just comma delimited...
I will also look into this more... Thanks for your help...