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

Combobox dropdown on every record change

P: n/a
Rey
Howdy, all.
Appreciate your help. Have a one to many relation between a client and
visit table.

In the visit subform, I have a visittype and counselor field which are
comboboxes. If I set either field to drop down via Me.dropdown in the
GotFocus event for the field, each time the client record changes the
visittype or counselor field drops down - only have the GotFocus event set
to one combobox at the moment - unless I move the cursor in the subform to a
different field, i.e. visitdate or visitreason.

I have not tried the onEnter event to see what happens there. Researched via
Google but did not find a response to the question...I'm coming from a
Paradox and VB background and am currently learning Access programming
w/V97.

Thanks in advance for your suggestions/help,

Rey
Nov 12 '05 #1
Share this Question
Share on Google+
6 Replies


P: n/a
Ok, I see what's happening. Now, could you tell what do you *want* to happen?
If you don't want the dropdown to occur on record changes, set tab order
for the combo box to something other that 0 or 1 so that they don't get
focus immediately.

Pavel

Rey wrote:

Howdy, all.
Appreciate your help. Have a one to many relation between a client and
visit table.

In the visit subform, I have a visittype and counselor field which are
comboboxes. If I set either field to drop down via Me.dropdown in the
GotFocus event for the field, each time the client record changes the
visittype or counselor field drops down - only have the GotFocus event set
to one combobox at the moment - unless I move the cursor in the subform to a
different field, i.e. visitdate or visitreason.

I have not tried the onEnter event to see what happens there. Researched via
Google but did not find a response to the question...I'm coming from a
Paradox and VB background and am currently learning Access programming
w/V97.

Thanks in advance for your suggestions/help,

Rey

Nov 12 '05 #2

P: n/a
Rey
Howdy, Pavel.
Thanks for your suggestion. Unfortunately, it won't work as there there are
5 fields in the subform but the first (visitnum) is set as no tab stop so
there are 4 tab stops only with visittype (1) and counselor (4). Also the
user enters the visit info in order of typem date, reasons, counselor.

What I want the combobox to do is dropdown when I arrive on field AND not
dropdown when I cycle through client records. BTW, this is Access97, if I
didn't mention it before.

The dropdown issue is that as I cycle through the client records, the
subform will drop down the visittype or counselor field depending on which
field I've uncommented the obj.dropdown code.

If I enter a new visit info and am in the Counselor field when I click the
Save btn AND then move to the next client record via the record selector,
the Counselor field will drop down. So I now have to move to the reason
field in the subform to remove the focus from the counselor field so that it
does not drop down on cycling through clients. If I move the cursor to the
first name field on the form from the counselor field, the counselor field
still drops down on cycling through clients. It also drops down if I click
on Save btn, which I have now modified to setfocus to first name field.

Even changing code to dropdown on enter vice gotfocus does the same. So
maybe the option is not to cause the combo to dropdown.

Hopefully this provides you more detail.

Thanks again,
Rey
"Pavel Romashkin" <pa*************@hotmail.com> wrote in message
news:3F***************@hotmail.com...
Ok, I see what's happening. Now, could you tell what do you *want* to happen? If you don't want the dropdown to occur on record changes, set tab order
for the combo box to something other that 0 or 1 so that they don't get
focus immediately.


Nov 12 '05 #3

P: n/a
"Rey" <re********@cox.net> wrote in
news:f8mcb.8558$gv5.77@fed1read05:
Howdy, Pavel.
Thanks for your suggestion. Unfortunately, it won't work as
there there are 5 fields in the subform but the first
(visitnum) is set as no tab stop so there are 4 tab stops only
with visittype (1) and counselor (4). Also the user enters the
visit info in order of typem date, reasons, counselor.

What I want the combobox to do is dropdown when I arrive on
field AND not dropdown when I cycle through client records.
BTW, this is Access97, if I didn't mention it before.
I think what you want is to dropdown when creating a new record and
not when scrolling through existing records on a form.

If this is so, use

if me.newrecord then [your combo name].dropdown


The dropdown issue is that as I cycle through the client
records, the subform will drop down the visittype or counselor
field depending on which field I've uncommented the
obj.dropdown code.

If I enter a new visit info and am in the Counselor field when
I click the Save btn AND then move to the next client record
via the record selector, the Counselor field will drop down.
So I now have to move to the reason field in the subform to
remove the focus from the counselor field so that it does not
drop down on cycling through clients. If I move the cursor to
the first name field on the form from the counselor field, the
counselor field still drops down on cycling through clients.
It also drops down if I click on Save btn, which I have now
modified to setfocus to first name field.

Even changing code to dropdown on enter vice gotfocus does the
same. So maybe the option is not to cause the combo to
dropdown.

Hopefully this provides you more detail.

Thanks again,
Rey
"Pavel Romashkin" <pa*************@hotmail.com> wrote in
message news:3F***************@hotmail.com...
Ok, I see what's happening. Now, could you tell what do you
*want* to

happen?
If you don't want the dropdown to occur on record changes,
set tab order for the combo box to something other that 0 or
1 so that they don't get focus immediately.



Nov 12 '05 #4

P: n/a
I see - if you move to next record right after using the self dropping
cb, it retains focus and self-drops immediately.
Try this simple approach:
In the form's Current event, set focus to another control that is not a
self-dropping combo box.
In the combo box GotFocus, make it drop down.
Works like a charm.
Cheers,
Pavel

Rey wrote:

Howdy, Pavel.
Thanks for your suggestion. Unfortunately, it won't work as there there are
5 fields in the subform but the first (visitnum) is set as no tab stop so
there are 4 tab stops only with visittype (1) and counselor (4). Also the
user enters the visit info in order of typem date, reasons, counselor.

What I want the combobox to do is dropdown when I arrive on field AND not
dropdown when I cycle through client records. BTW, this is Access97, if I
didn't mention it before.

The dropdown issue is that as I cycle through the client records, the
subform will drop down the visittype or counselor field depending on which
field I've uncommented the obj.dropdown code.

If I enter a new visit info and am in the Counselor field when I click the
Save btn AND then move to the next client record via the record selector,
the Counselor field will drop down. So I now have to move to the reason
field in the subform to remove the focus from the counselor field so that it
does not drop down on cycling through clients. If I move the cursor to the
first name field on the form from the counselor field, the counselor field
still drops down on cycling through clients. It also drops down if I click
on Save btn, which I have now modified to setfocus to first name field.

Even changing code to dropdown on enter vice gotfocus does the same. So
maybe the option is not to cause the combo to dropdown.

Hopefully this provides you more detail.

Thanks again,
Rey

"Pavel Romashkin" <pa*************@hotmail.com> wrote in message
news:3F***************@hotmail.com...
Ok, I see what's happening. Now, could you tell what do you *want* to

happen?
If you don't want the dropdown to occur on record changes, set tab order
for the combo box to something other that 0 or 1 so that they don't get
focus immediately.

Nov 12 '05 #5

P: n/a
Rey
Howdy, Bob.

Thanks for the suggestion. It worked great. Totally missed the new rec
relation - duh!

Also thanks again, Pavel for your suggestion. Tried it also.

Thanks again,

Rey

"Bob Quintal" <bq******@generation.net> wrote in message
news:a1******************************@news.teranew s.com...
"Rey" <re********@cox.net> wrote in
news:f8mcb.8558$gv5.77@fed1read05:
I think what you want is to dropdown when creating a new record and
not when scrolling through existing records on a form.

If this is so, use

if me.newrecord then [your combo name].dropdown


Nov 12 '05 #6

P: n/a
"Rey" <re********@cox.net> wrote in
news:R0qcb.10153$gv5.1586@fed1read05:
Howdy, Bob.

Thanks for the suggestion. It worked great. Totally missed the
new rec relation - duh!
I missed the new rec relation three or four times when I started
programming. :)

Bob Q.


Also thanks again, Pavel for your suggestion. Tried it also.

Thanks again,

Rey

"Bob Quintal" <bq******@generation.net> wrote in message
news:a1******************************@news.teranew s.com...
"Rey" <re********@cox.net> wrote in
news:f8mcb.8558$gv5.77@fed1read05:
I think what you want is to dropdown when creating a new
record and not when scrolling through existing records on a
form.

If this is so, use

if me.newrecord then [your combo name].dropdown



Nov 12 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.