G
Guest
In order to improve performance of my Access application I do not bind forms
to data sources directly, but set them up, with filters, in the Form_Open
events. I use this throughout my app, and it really improves the snappyness
of just about everything.
One form is only usable if the data has particular properties. So after
looking the data up, I check if it is appropriate and then cancel the form if
it's not. Here is the code (Access is locked up, I have to copy this by
hand)...
if rstOrder.recordCount = 1 then
msgbox "There is only one line on this order, no need to calculate a
total."
Cancel = true
Exit sub
end if
When this code runs I get an error _outside_ the Form_Open, "OpenForm was
cancelled..." The dialog allows me to press "Ok". When you do, Access appears
to go into some sort of tight loop, and I have to force quit.
Adding to the confusion is the problem that I cannot seem to step into the
Form_Open. Single-stepping in pops up the error without going into the
Form_Open, and setting breakpoints inside the code does nothing.
Finally, if the rstOrder DOES have more than one line, it works fine. So
something is wrong inside these lines, but I can't imagine what. Is there
some sort of ordering to the lines that is important?
Any ideas?
Maury
to data sources directly, but set them up, with filters, in the Form_Open
events. I use this throughout my app, and it really improves the snappyness
of just about everything.
One form is only usable if the data has particular properties. So after
looking the data up, I check if it is appropriate and then cancel the form if
it's not. Here is the code (Access is locked up, I have to copy this by
hand)...
if rstOrder.recordCount = 1 then
msgbox "There is only one line on this order, no need to calculate a
total."
Cancel = true
Exit sub
end if
When this code runs I get an error _outside_ the Form_Open, "OpenForm was
cancelled..." The dialog allows me to press "Ok". When you do, Access appears
to go into some sort of tight loop, and I have to force quit.
Adding to the confusion is the problem that I cannot seem to step into the
Form_Open. Single-stepping in pops up the error without going into the
Form_Open, and setting breakpoints inside the code does nothing.
Finally, if the rstOrder DOES have more than one line, it works fine. So
something is wrong inside these lines, but I can't imagine what. Is there
some sort of ordering to the lines that is important?
Any ideas?
Maury