I´m doing some calculations in the "on formatting" on details.... the result of this calculation is then put in a textfile using this code (its only 1 and 0 )
Dim Strantal as string
Open "c:\antal.txt" For Append As #1
strantal = Me.oomantal
Write #1, strantal
Close #1
antal.txt
1
0
1
0
0
0
1
1
I use this information as a base for another report, the problem is that I get the wrong number of values. After some testing I realized that it(access) first puts all the values in the textfile and when Access loads the report into memmory and that way it puts the values once again in the textfile.
If the report is shorter than 3-4 pages I then get the values two times and if the report is longer I get the values once plus how many values access has put in memmory (how many pages access has formatted). If I then go to last page it puts all the values and gives the same result as a shorter report(all the values twice).
My question is, how do I put the value in the textfile only once (is there a way to do a loop who can fix this?, check where the last value is) or is there some other way that I could get this thing to work?
Would love some ideas about my problem
Micke "Sweden"
Dim Strantal as string
Open "c:\antal.txt" For Append As #1
strantal = Me.oomantal
Write #1, strantal
Close #1
antal.txt
1
0
1
0
0
0
1
1
I use this information as a base for another report, the problem is that I get the wrong number of values. After some testing I realized that it(access) first puts all the values in the textfile and when Access loads the report into memmory and that way it puts the values once again in the textfile.
If the report is shorter than 3-4 pages I then get the values two times and if the report is longer I get the values once plus how many values access has put in memmory (how many pages access has formatted). If I then go to last page it puts all the values and gives the same result as a shorter report(all the values twice).
My question is, how do I put the value in the textfile only once (is there a way to do a loop who can fix this?, check where the last value is) or is there some other way that I could get this thing to work?
Would love some ideas about my problem
Micke "Sweden"