Subform's First Control is an Autodrop CBO

  • Thread starter Thread starter croy
  • Start date Start date
C

croy

A subform combobox is set to drop down automatically when it
gets the focus. It is the first control in the tab-order to
get the focus.

when navigating thru records on the main form, the subform
cbo drops down briefly. It's rather disconcerting for
users.

I've tried using EchoOn = false in the OnCurrent event for
the subform, but this doesn't keep the drop from showing.

Any thoughts?
 
croy said:
A subform combobox is set to drop down automatically when it
gets the focus. It is the first control in the tab-order to
get the focus.

when navigating thru records on the main form, the subform
cbo drops down briefly. It's rather disconcerting for
users.

I've tried using EchoOn = false in the OnCurrent event for
the subform, but this doesn't keep the drop from showing.

Any thoughts?

You could try this (untested) :

1. Create a module level public boolean variable (ie one declared before any
procedures) in the subform's module, called SubformHasFocus:

Public SubformHasFocus As Boolean

2. Put code like this in the OnEnter event proc for the subform control on
the main form:

Me.SubformControlName.Form.SubformHasFocus = True

3. Put the opposite code in the subform control's OnExit event proc:

Me.SubformControlName.Form.SubformHasFocus = False

4. Change the subform's OnCurrent event proc to:

If SubformHasFocus Then Me.ComboName.DropDown


Remember - the code mentioned in 2 and 3 should be for the subform control
on the main form, not the subform itself.
 
You could try this (untested) :

1. Create a module level public boolean variable (ie one declared before any
procedures) in the subform's module, called SubformHasFocus:

Public SubformHasFocus As Boolean

2. Put code like this in the OnEnter event proc for the subform control on
the main form:

Me.SubformControlName.Form.SubformHasFocus = True

3. Put the opposite code in the subform control's OnExit event proc:

Me.SubformControlName.Form.SubformHasFocus = False

4. Change the subform's OnCurrent event proc to:

If SubformHasFocus Then Me.ComboName.DropDown


Remember - the code mentioned in 2 and 3 should be for the subform control
on the main form, not the subform itself.


Thanks Stuart. That looked really good, but I haven't got
it working yet.

When the subform control gets the focus, up pops a dialog
stating, "CVAS can't find the macro 'Me.'"

So I put "=" in front of each of those two -- no help.

So I took out the "Me." on each of those, and no more nasty
messages, but the dropdown doesn't occur when the subform
gets the focus.

So I changed the subform's OnCurrent code to

If SubformHasFocus = True Then Me.ComboName.DropDown

....but still no dropdown occurs.

I've double checked all the locations for the bits you gave
me, and I'm pretty darn sure they're all in the right
places.

My "try this" approach is about out of fuel.

Any thoughts?

Thanks again,
croy
 
You could try this (untested) :

1. Create a module level public boolean variable (ie one declared before any
procedures) in the subform's module, called SubformHasFocus:

Public SubformHasFocus As Boolean

2. Put code like this in the OnEnter event proc for the subform control on
the main form:

Me.SubformControlName.Form.SubformHasFocus = True

3. Put the opposite code in the subform control's OnExit event proc:

Me.SubformControlName.Form.SubformHasFocus = False

4. Change the subform's OnCurrent event proc to:

If SubformHasFocus Then Me.ComboName.DropDown


Remember - the code mentioned in 2 and 3 should be for the subform control
on the main form, not the subform itself.


Thanks Stuart. After a few erros on my part, it works
perfectly.
 
Back
Top