473,395 Members | 1,941 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Combobox dropdown on every record change

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
6 7336
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
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
"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
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
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
"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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Rey | last post by:
How can I update every record of a given table one by one. I need to update a field (date) with a different, random date for each record. loop { generate random date; update one record with...
0
by: Karl | last post by:
Hi all, I want to do some datasource refresh when my combobox dropdown list closes sup. Which event should I call? Thanks, Karl
3
by: Brian Henry | last post by:
Is there anyway to prevent the white box that drops down when you do a combobox dropdown from showing? I am trying to make a custom combobox which requires showing a custom form in its place, but...
5
by: Gil | last post by:
Is there a way to tell if a combbox is in dropdown mode. I tried and if statement combobox.dropdown = true but i get an error. dropwndown function doesnt store if its true or false what i am...
4
by: neoman007 | last post by:
I have a form (frm_approval) which is based on a query (qry_unapproved). The query queries a table (tbl_total) for records that are unapproved and shows these records in (frm_approval) so the...
6
by: Richard Hollenbeck | last post by:
Thanks to everybody who has helped me to get this thing finally working (somewhat). I got the field names to properly display in the PageHeaderSection, so I won't post the code from that. Now I'm...
3
by: chrispy102 | last post by:
Hi all, I have an MDI app developed using vis studio 2005. The problem I have is that evey time I close a Child form and open another, the CPU PF Usage increments slighty. This happens every time...
0
by: Andrus | last post by:
SWF ComboBox dropdown menu first item selection must open picklist. For this I use the following code: protected override void OnSelectedIndexChanged(System.EventArgs e) { if (SelectedIndex != 0...
2
by: Mel | last post by:
Can anyone assist me in how I would structure this code to update every record in a table? I need to loop through each record and increase the cost field by a certain percentage. How do I loop...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.