G
Guest
Hello everyone,
We have an Access 2002 application that has a single form that is accessed
from a single PC. The purpose of the application is to continually process
some data for the company as if it were a service. For the most part the
application runs fine for a day or two then odd errors begin to appear. If I
end the code, close the database, and restart it everything is fine again for
a while.
The most common error is error 5 ("Invalid Property Assignment"), it occurs
when the code attempts to assign a labels caption like this:
for outerloop = 1 to somecount
lblTest.caption = ""
for innerloop = 1 to someothercount
lblTest.caption = lblTest.caption & " more text."
next innerloop
next outerloop
if in debug mode, I set the labels caption to "" then run the code
everything is fine. Once this code gets into this state any caption
assignment to any label that follows the same convention is affected.
I am sure that this error is a red herring and that there is another issue
at hand. We recieve this error weather the database is compiled into an mde
or a plain mdb. The error is not predictable or easily reproducable and a
restart of the application seems to correct the problem for a while.
I think that I will need to use an interim string variable to hold the
caption value then reassign the value to the caption like this:
dim sTemp as string
for outerloop = 1 to somecount
lblTest.caption = ""
for innerloop = 1 to someothercount
sTemp = ""
sTemp = lblTest.caption & " more text."
lblTest.caption = sTemp
next innerloop
next outerloop
There quite a few labels on this form and a number of places where
assignments are set. I was hopeing that someone has encountered this before
and point me into the direction to figure out what is going here. Granted
Access may not have been the most ideal solution for this application but it
is what I have inherited and it is a mammoth project for porting anywhere
else, so in the meantime, I need to stabilize.
Thanks in advance,
Matthew
We have an Access 2002 application that has a single form that is accessed
from a single PC. The purpose of the application is to continually process
some data for the company as if it were a service. For the most part the
application runs fine for a day or two then odd errors begin to appear. If I
end the code, close the database, and restart it everything is fine again for
a while.
The most common error is error 5 ("Invalid Property Assignment"), it occurs
when the code attempts to assign a labels caption like this:
for outerloop = 1 to somecount
lblTest.caption = ""
for innerloop = 1 to someothercount
lblTest.caption = lblTest.caption & " more text."
next innerloop
next outerloop
if in debug mode, I set the labels caption to "" then run the code
everything is fine. Once this code gets into this state any caption
assignment to any label that follows the same convention is affected.
I am sure that this error is a red herring and that there is another issue
at hand. We recieve this error weather the database is compiled into an mde
or a plain mdb. The error is not predictable or easily reproducable and a
restart of the application seems to correct the problem for a while.
I think that I will need to use an interim string variable to hold the
caption value then reassign the value to the caption like this:
dim sTemp as string
for outerloop = 1 to somecount
lblTest.caption = ""
for innerloop = 1 to someothercount
sTemp = ""
sTemp = lblTest.caption & " more text."
lblTest.caption = sTemp
next innerloop
next outerloop
There quite a few labels on this form and a number of places where
assignments are set. I was hopeing that someone has encountered this before
and point me into the direction to figure out what is going here. Granted
Access may not have been the most ideal solution for this application but it
is what I have inherited and it is a mammoth project for porting anywhere
else, so in the meantime, I need to stabilize.
Thanks in advance,
Matthew