K
krulle
Guest
Hello,
I have a table with 120 records and 2 fields. I query this table. In the query a 3th field has been created referring to a function in a module.
The module looks like this:
Public function company (id as integer) as string
if id = 100 then
open "c:\company.txt" for output as #1
print #1, "record 100"
close #1
end if
end function.
If I run the query the file company.txt is not created. When I put a watch window on the id value I see that the id value gets "out of context" exactly on record 36 and the functions stops.
If I change the function like below the file company.txt gets created well
Public function company (id as integer) as string
if id = 20 then
open "c:\company.txt" for output as #1
print #1, "record 20"
close #1
end if
end function.
I really don't understand why the function stops each time on record 36.
I created a new table with other values, made a new access database on my and other PC. but still the same problem persists.
I getting more and more hopeless
Does someone know what could be the solution?
ps: This is an example of my problem. In my real program I have to make 150 txt files. My due date to find a solution is 16/9 as I have to import these txt files in another application.
Thanks a lot!!!
claeystina@hotmail.com
I have a table with 120 records and 2 fields. I query this table. In the query a 3th field has been created referring to a function in a module.
The module looks like this:
Public function company (id as integer) as string
if id = 100 then
open "c:\company.txt" for output as #1
print #1, "record 100"
close #1
end if
end function.
If I run the query the file company.txt is not created. When I put a watch window on the id value I see that the id value gets "out of context" exactly on record 36 and the functions stops.
If I change the function like below the file company.txt gets created well
Public function company (id as integer) as string
if id = 20 then
open "c:\company.txt" for output as #1
print #1, "record 20"
close #1
end if
end function.
I really don't understand why the function stops each time on record 36.

I created a new table with other values, made a new access database on my and other PC. but still the same problem persists.
I getting more and more hopeless

Does someone know what could be the solution?
ps: This is an example of my problem. In my real program I have to make 150 txt files. My due date to find a solution is 16/9 as I have to import these txt files in another application.
Thanks a lot!!!
claeystina@hotmail.com