By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,968 Members | 1,843 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,968 IT Pros & Developers. It's quick & easy.

Event triggering incorrectly

P: 16
hello all,

I've been trying to figure this out for days but i don't know what the problem is. I have this form which contains 2 subforms on it. On one of the subforms there is a fields called "Range" which has an "OnGotFocus" event on it. My problem is that when i click on the first field in the subform (not Range), the Range field's OnGotFocus event is triggering. Does anybody have any idea what the problem might be?

Thanks in advance,
Christina
Mar 18 '07 #1
Share this Question
Share on Google+
7 Replies


P: 16
hello all,

I've been trying to figure this out for days but i don't know what the problem is. I have this form which contains 2 subforms on it. On one of the subforms there is a fields called "Range" which has an "OnGotFocus" event on it. My problem is that when i click on the first field in the subform (not Range), the Range field's OnGotFocus event is triggering. Does anybody have any idea what the problem might be?

Thanks in advance,
Christina

Hello again everyone,

Since i havent gotten any replies im guessing maybe my question isnt clear. I will give it another go. My problem is that i have an "OnGotFocus" event for a field called "Range" triggering, when i give focus to the subform the field is on, instead of when focus is giving to the field itself.

Any ideas what's going on?

Thanks again,
Christina
Mar 19 '07 #2

missinglinq
Expert 2.5K+
P: 3,532
A form, and hence a subform, can only receive focus if

1) It has no controls on it that can receive focus

2) It has controls on it that can receive focus but they are all disabled

Otherwise, when you "set focus" on a form, the focus is actually set on the first control (what you call a field) of the form, in this case, apparently, a control named Range, and hence the GotFocus event is being triggered.
Mar 19 '07 #3

P: 16
A form, and hence a subform, can only receive focus if

1) It has no controls on it that can receive focus

2) It has controls on it that can receive focus but they are all disabled

Otherwise, when you "set focus" on a form, the focus is actually set on the first control (what you call a field) of the form, in this case, apparently, a control named Range, and hence the GotFocus event is being triggered.

Thanks for you response,
I get what your saying but the problem is that the field range is not the first control.....the event is getting triggered when i click on the actuall first control which is a field named "Farm".

i would really appreciate any help with this.
Thanks,
Christina
Mar 19 '07 #4

Rabbit
Expert Mod 10K+
P: 12,347
Have you tried renaming Range? You'd have to rename the Sub in the code as well.
Mar 19 '07 #5

missinglinq
Expert 2.5K+
P: 3,532
Clicking on a control named Farm and having the GotFocus event for a control named Ranch triggered makes no sense! First thing I'd do is doublecheck the code behind events for both of these controls, to make sure that you haven't typed in one name when you meant the other; we've all done this at one time or the other. The next thing to consider, as always when things go completely haywire, is that your form/db has been corrupted. You might want to try the old "create a blank db and import all objects into it" routine to see if that resolves the problem.
Mar 19 '07 #6

P: 16
Clicking on a control named Farm and having the GotFocus event for a control named Ranch triggered makes no sense! First thing I'd do is doublecheck the code behind events for both of these controls, to make sure that you haven't typed in one name when you meant the other; we've all done this at one time or the other. The next thing to consider, as always when things go completely haywire, is that your form/db has been corrupted. You might want to try the old "create a blank db and import all objects into it" routine to see if that resolves the problem.

Thanks alot for your help, i went throught all of the code related to the range field and found that i had typed in the wrong field name like you said.....Cant believe i did that. All is working now :)

Thanks again for all your help,
Christina
Mar 20 '07 #7

missinglinq
Expert 2.5K+
P: 3,532
As I said above, we've all done it before!! Glad you got it sorted out!
Mar 20 '07 #8

Post your reply

Sign in to post your reply or Sign up for a free account.