OK, I get this error in 2 different circumstances (so far) in some of my various forms. That said, I wouldn't be surprised if they are fixed the same way or have the same root cause.
Circumstance 1
I have a form w/ a combo box and buttons. You select the person who's records you want from the combo box and then click the button for the form that you want to see w/ this person's records....
What happens?
A. If you select someone who exists, you get just there records. That's fine, that's what I want.
B. If you leave the combo box blank you get everyone's records. This is also fine.
C. You mistype a name or type in a name that has not records associated with it? You get the 'Runtime 2015' error.
I know I could fix this by using a list box, but then they wouldn't be able to see all the records like they can on option B. I'm hopeful there's a small pieces of syntax I can just put in there to prevent this?
Circumstance 2
Very similar... I have a form that opens a sub-form. The sub-form is set up to list the records from last to first (numerically).
What happens?
A. The main form record has sub-records that match and thus the sub-form displays them, starting with the last one and counting down. Like it would start on 5 you slide down to 1. Perfect.
B. The main form record has zero records in the table that the sub-form is referencing. You get the 'Runtime 2015' error..
When I don't sort from back to front, I never get this error. I'm sure that, like Circumstance 1, its expecting to find something and generates this error when it finds nothing.
So, hopefully the answer to this question is the same for both circumstances.
Thanks for whatever assistance you can provide.
Circumstance 1
I have a form w/ a combo box and buttons. You select the person who's records you want from the combo box and then click the button for the form that you want to see w/ this person's records....
What happens?
A. If you select someone who exists, you get just there records. That's fine, that's what I want.
B. If you leave the combo box blank you get everyone's records. This is also fine.
C. You mistype a name or type in a name that has not records associated with it? You get the 'Runtime 2015' error.
I know I could fix this by using a list box, but then they wouldn't be able to see all the records like they can on option B. I'm hopeful there's a small pieces of syntax I can just put in there to prevent this?
Circumstance 2
Very similar... I have a form that opens a sub-form. The sub-form is set up to list the records from last to first (numerically).
What happens?
A. The main form record has sub-records that match and thus the sub-form displays them, starting with the last one and counting down. Like it would start on 5 you slide down to 1. Perfect.
B. The main form record has zero records in the table that the sub-form is referencing. You get the 'Runtime 2015' error..
When I don't sort from back to front, I never get this error. I'm sure that, like Circumstance 1, its expecting to find something and generates this error when it finds nothing.
So, hopefully the answer to this question is the same for both circumstances.
Thanks for whatever assistance you can provide.