Combo offset

B

Bill

Got me stumped.............

==================================

Private Sub Form_Open(Cancel As Integer)
a = Split(Me.OpenArgs, ";")

Me.RecordsetClone.FindFirst "[RecordID] = " & a(0)
Me.Bookmark = Me.RecordsetClone.Bookmark

Call setImagePath

If UBound(a) > 0 Then
If a(1) = "New" Then
Me.cmboClasses.SetFocus
Me.cmboClasses.Dropdown
End If
End If

End Sub

=================================
Form opens and the combo box drops down, except
that the dropped portion looks like a listbox and is
about 1-inch below the combo box and 3/4-inches
to the right of the combo box.
 
J

Jeanette Cunningham

Bill,
This happens to a combo when there is not enough room for the entire list to
fit between the combo and the bottom of the display window.
Try setting the number of rows displayed in your combo to a smaller number
until the combo displays normally.

Jeanette Cunningham
 
B

Bill

Jeanette,
That doesn't seem to be the problem. There's plenty of
room for more rows than I've specified in the "List Rows"
property of the combo.
Bill



Jeanette Cunningham said:
Bill,
This happens to a combo when there is not enough room for the entire list
to fit between the combo and the bottom of the display window.
Try setting the number of rows displayed in your combo to a smaller number
until the combo displays normally.

Jeanette Cunningham



Bill said:
Got me stumped.............

==================================

Private Sub Form_Open(Cancel As Integer)
a = Split(Me.OpenArgs, ";")

Me.RecordsetClone.FindFirst "[RecordID] = " & a(0)
Me.Bookmark = Me.RecordsetClone.Bookmark

Call setImagePath

If UBound(a) > 0 Then
If a(1) = "New" Then
Me.cmboClasses.SetFocus
Me.cmboClasses.Dropdown
End If
End If

End Sub

=================================
Form opens and the combo box drops down, except
that the dropped portion looks like a listbox and is
about 1-inch below the combo box and 3/4-inches
to the right of the combo box.
 
M

Marshall Barton

Bill said:
Got me stumped.............

==================================

Private Sub Form_Open(Cancel As Integer)
a = Split(Me.OpenArgs, ";")

Me.RecordsetClone.FindFirst "[RecordID] = " & a(0)
Me.Bookmark = Me.RecordsetClone.Bookmark

Call setImagePath

If UBound(a) > 0 Then
If a(1) = "New" Then
Me.cmboClasses.SetFocus
Me.cmboClasses.Dropdown
End If
End If

End Sub

=================================
Form opens and the combo box drops down, except
that the dropped portion looks like a listbox and is
about 1-inch below the combo box and 3/4-inches
to the right of the combo box.


Another possibility is that the Open event is too early for
the form and its data to be stabilized. Try using the Load
event instead.
 
J

Jeanette Cunningham

Bill,
that is the only reason I have ever found for the problem you describe.
Maybe I am misunderstanding your description. Perhaps someone else can help.

Jeanette Cunningham


Bill said:
Jeanette,
That doesn't seem to be the problem. There's plenty of
room for more rows than I've specified in the "List Rows"
property of the combo.
Bill



Jeanette Cunningham said:
Bill,
This happens to a combo when there is not enough room for the entire list
to fit between the combo and the bottom of the display window.
Try setting the number of rows displayed in your combo to a smaller
number until the combo displays normally.

Jeanette Cunningham



Bill said:
Got me stumped.............

==================================

Private Sub Form_Open(Cancel As Integer)
a = Split(Me.OpenArgs, ";")

Me.RecordsetClone.FindFirst "[RecordID] = " & a(0)
Me.Bookmark = Me.RecordsetClone.Bookmark

Call setImagePath

If UBound(a) > 0 Then
If a(1) = "New" Then
Me.cmboClasses.SetFocus
Me.cmboClasses.Dropdown
End If
End If

End Sub

=================================
Form opens and the combo box drops down, except
that the dropped portion looks like a listbox and is
about 1-inch below the combo box and 3/4-inches
to the right of the combo box.
 
B

Bill

With the code below in the OnLoad event,
and with BreakPoints set to confirm the
path taken, both the SetFocus and Dropdown
executed without error, but BOTH were
ignored, as the focus was on the field set in the
OnOpen.

Bill

================================
If UBound(a) > 0 Then
If a(1) = "New" Then
Me.cmboClasses.SetFocus
Me.cmboClasses.Dropdown
End If
End If
================================
Marshall Barton said:
Bill said:
Got me stumped.............

==================================

Private Sub Form_Open(Cancel As Integer)
a = Split(Me.OpenArgs, ";")

Me.RecordsetClone.FindFirst "[RecordID] = " & a(0)
Me.Bookmark = Me.RecordsetClone.Bookmark

Me.LastName.SetFocus

Call setImagePath

If UBound(a) > 0 Then
If a(1) = "New" Then
Me.cmboClasses.SetFocus
Me.cmboClasses.Dropdown
End If
End If

End Sub

=================================
Form opens and the combo box drops down, except
that the dropped portion looks like a listbox and is
about 1-inch below the combo box and 3/4-inches
to the right of the combo box.


Another possibility is that the Open event is too early for
the form and its data to be stabilized. Try using the Load
event instead.
 
B

Bill

As a last resort, I followed Allen Browne's procedure
to repair a corrupted mdb, but the problem still persists
where the SetFocus and DropDown code is ignored.
See my previous post from Thursday, 3:57PM PST
USA.

Any ideas here would be appreciated.

Bill
 
J

Jeanette Cunningham

Bill,
try moving the code that sets the focus from the Open event to the Load
event.
In the Load event, make it the last piece of code in the load event.

Jeanette Cunningham


Bill said:
As a last resort, I followed Allen Browne's procedure
to repair a corrupted mdb, but the problem still persists
where the SetFocus and DropDown code is ignored.
See my previous post from Thursday, 3:57PM PST
USA.

Any ideas here would be appreciated.

Bill



Bill said:
Got me stumped.............

==================================

Private Sub Form_Open(Cancel As Integer)
a = Split(Me.OpenArgs, ";")

Me.RecordsetClone.FindFirst "[RecordID] = " & a(0)
Me.Bookmark = Me.RecordsetClone.Bookmark

Call setImagePath

If UBound(a) > 0 Then
If a(1) = "New" Then
Me.cmboClasses.SetFocus
Me.cmboClasses.Dropdown
End If
End If

End Sub

=================================
Form opens and the combo box drops down, except
that the dropped portion looks like a listbox and is
about 1-inch below the combo box and 3/4-inches
to the right of the combo box.
 
B

Bill

Hi Jeanette,
As I posted in reply to Marsh yesterday:

"With the code below in the OnLoad event,
and with BreakPoints set to confirm the
path taken, both the SetFocus and Dropdown
executed without error, but BOTH WERE
IGNORED. The focus was on the field set in the
OnOpen."

I've moved the combo control to different postions
in the detail section of the form, but it just doesn't
matter. ALL the other combo boxes on the other
forms respond normally to SetFocus and DropDown,
though they ARE NOT triggered at Open/Load time.

The offending combo box responds normally to a
user action once the form displays.

Bill

================================
If UBound(a) > 0 Then
If a(1) = "New" Then
Me.cmboClasses.SetFocus
Me.cmboClasses.Dropdown
End If
End If
================================

Jeanette Cunningham said:
Bill,
try moving the code that sets the focus from the Open event to the Load
event.
In the Load event, make it the last piece of code in the load event.

Jeanette Cunningham


Bill said:
As a last resort, I followed Allen Browne's procedure
to repair a corrupted mdb, but the problem still persists
where the SetFocus and DropDown code is ignored.
See my previous post from Thursday, 3:57PM PST
USA.

Any ideas here would be appreciated.

Bill



Bill said:
Got me stumped.............

==================================

Private Sub Form_Open(Cancel As Integer)
a = Split(Me.OpenArgs, ";")

Me.RecordsetClone.FindFirst "[RecordID] = " & a(0)
Me.Bookmark = Me.RecordsetClone.Bookmark

Call setImagePath

If UBound(a) > 0 Then
If a(1) = "New" Then
Me.cmboClasses.SetFocus
Me.cmboClasses.Dropdown
End If
End If

End Sub

=================================
Form opens and the combo box drops down, except
that the dropped portion looks like a listbox and is
about 1-inch below the combo box and 3/4-inches
to the right of the combo box.
 
M

Marshall Barton

Bill said:
With the code below in the OnLoad event,
and with BreakPoints set to confirm the
path taken, both the SetFocus and Dropdown
executed without error, but BOTH were
ignored, as the focus was on the field set in the
OnOpen.

================================
If UBound(a) > 0 Then
If a(1) = "New" Then
Me.cmboClasses.SetFocus
Me.cmboClasses.Dropdown
End If
End If


The dropdown should work, but will only remain down as long
as the focus stays on the combo box. Maybe you have some
other code (in the Current event?) that is resetting the
focus?? OTOH, maybe you need to move that code to the
Current event so nothing else can interfere with it.
 
J

Jeanette Cunningham

I assume then that the problem is fixed?

Jeanette Cunningham

Bill said:
Hi Jeanette,
As I posted in reply to Marsh yesterday:

"With the code below in the OnLoad event,
and with BreakPoints set to confirm the
path taken, both the SetFocus and Dropdown
executed without error, but BOTH WERE
IGNORED. The focus was on the field set in the
OnOpen."

I've moved the combo control to different postions
in the detail section of the form, but it just doesn't
matter. ALL the other combo boxes on the other
forms respond normally to SetFocus and DropDown,
though they ARE NOT triggered at Open/Load time.

The offending combo box responds normally to a
user action once the form displays.

Bill

================================
If UBound(a) > 0 Then
If a(1) = "New" Then
Me.cmboClasses.SetFocus
Me.cmboClasses.Dropdown
End If
End If
================================

Jeanette Cunningham said:
Bill,
try moving the code that sets the focus from the Open event to the Load
event.
In the Load event, make it the last piece of code in the load event.

Jeanette Cunningham


Bill said:
As a last resort, I followed Allen Browne's procedure
to repair a corrupted mdb, but the problem still persists
where the SetFocus and DropDown code is ignored.
See my previous post from Thursday, 3:57PM PST
USA.

Any ideas here would be appreciated.

Bill



Got me stumped.............

==================================

Private Sub Form_Open(Cancel As Integer)
a = Split(Me.OpenArgs, ";")

Me.RecordsetClone.FindFirst "[RecordID] = " & a(0)
Me.Bookmark = Me.RecordsetClone.Bookmark

Call setImagePath

If UBound(a) > 0 Then
If a(1) = "New" Then
Me.cmboClasses.SetFocus
Me.cmboClasses.Dropdown
End If
End If

End Sub

=================================
Form opens and the combo box drops down, except
that the dropped portion looks like a listbox and is
about 1-inch below the combo box and 3/4-inches
to the right of the combo box.
 
B

Bill

Marsh,

With the code below in EITHER the OnCurrent
or OnLoad events, the combo SetFocus and
Dropdown now are working again. NOTE that the
else case now sets the focus on a different field,
where that statement USED to be in the OnOpen
event, which means you were right about another
statement taking the focus away from the combo.

So, now we've returned to the Dropdown shifting
the display of the combo over and down from the
base of the combo itself, i.e., just looks like a list
box off to the side of the combo.

If UBound(a) > 0 Then
If a(1) = "New" Then
Me.cmboClasses.SetFocus
Me.cmboClasses.Dropdown
End If
Else
LastName.SetFocus
End If

Really clueless about what could be happening.

I assume you saw my earlier post where I mentioned
that I'd run Allen Browne's recovery process for
currupted mdbs, which didn't solve the problem.

Bill
 
B

Bill

Hi Jeanette,
No, I'm afraid not. See my last reply to
Marsh Barton.
Bill


Jeanette Cunningham said:
I assume then that the problem is fixed?

Jeanette Cunningham

Bill said:
Hi Jeanette,
As I posted in reply to Marsh yesterday:

"With the code below in the OnLoad event,
and with BreakPoints set to confirm the
path taken, both the SetFocus and Dropdown
executed without error, but BOTH WERE
IGNORED. The focus was on the field set in the
OnOpen."

I've moved the combo control to different postions
in the detail section of the form, but it just doesn't
matter. ALL the other combo boxes on the other
forms respond normally to SetFocus and DropDown,
though they ARE NOT triggered at Open/Load time.

The offending combo box responds normally to a
user action once the form displays.

Bill

================================
If UBound(a) > 0 Then
If a(1) = "New" Then
Me.cmboClasses.SetFocus
Me.cmboClasses.Dropdown
End If
End If
================================

Jeanette Cunningham said:
Bill,
try moving the code that sets the focus from the Open event to the Load
event.
In the Load event, make it the last piece of code in the load event.

Jeanette Cunningham


As a last resort, I followed Allen Browne's procedure
to repair a corrupted mdb, but the problem still persists
where the SetFocus and DropDown code is ignored.
See my previous post from Thursday, 3:57PM PST
USA.

Any ideas here would be appreciated.

Bill



Got me stumped.............

==================================

Private Sub Form_Open(Cancel As Integer)
a = Split(Me.OpenArgs, ";")

Me.RecordsetClone.FindFirst "[RecordID] = " & a(0)
Me.Bookmark = Me.RecordsetClone.Bookmark

Call setImagePath

If UBound(a) > 0 Then
If a(1) = "New" Then
Me.cmboClasses.SetFocus
Me.cmboClasses.Dropdown
End If
End If

End Sub

=================================
Form opens and the combo box drops down, except
that the dropped portion looks like a listbox and is
about 1-inch below the combo box and 3/4-inches
to the right of the combo box.
 
B

Bill

I just tried a repaint after the dropdown, but it
had no effect on the "disjointed" display of the
combo.

Thanks though for your suggestion,
Bill
 
R

Ron2006

Sorry it didn't work. I seem to halfway remember something like that
happening a long time ago, but it has been a long week.

Does the form seem to jump?

Try making sure that no buttons or extra menus are viewable when you
save the form out of design mode. I have seen button menus open at
design time but NOT requested a run time cause the form to jump up and
that could be happening here since the box is appearing below where it
should be.

Good luck.

Ron
 
B

Bill

The box stays correctly positioned, but the expanded
portion is disjointed from the combo itself. As a stretch,
I wondered if the positioning coordinates got messed up
and might show up if I captured them in a Debug.Print.
Nothing seems disturbed:

(Form_Load) Before DropDown
Left: 11100
Right: 960
Width: 1800
Height: 300
(Form_Load) After DropDown
Left: 11100
Right: 960
Width: 1800
Height: 300

Bill
 
R

Ron2006

The box may be perfectly correct, but because of the fast speed of
your computer you may not see a jump but the dropdown part was set
BEFORE it "jumped"

Are the conditions true that there are NO buttons viewable when you
save the form in design mode?

And I know I have seen it, but cannot remember what the solution
was......... ARRRRGGGGHHHHHH

Ron
 
J

Jeanette Cunningham

Bill,
coming at this from a completely different angle, assuming a solution that
does not try to fix what you currently have going wrong, but looks for
something that does work.
I routinely use code like this in form load events to set up a combo

I am using a saved query to check if the value I want to display in the
combo is in the currently set (by code) row source for the combo.

note: TrID is the bound column of the combo
lngTrID is a variable passed in with Open Args

If DCount("[TrID]", "qChkChosenTrack", strCriteria) > 0 Then
'yes chosen track is in the combo's list
Me.cboTrID = lngTrID
Else
'drop down the track combo
Me.cboTrID.SetFocus
Me.cboTrID.Dropdown
End If

Jeanette Cunningham
 
B

Bill

And "strCriteria"?


Jeanette Cunningham said:
Bill,
coming at this from a completely different angle, assuming a solution that
does not try to fix what you currently have going wrong, but looks for
something that does work.
I routinely use code like this in form load events to set up a combo

I am using a saved query to check if the value I want to display in the
combo is in the currently set (by code) row source for the combo.

note: TrID is the bound column of the combo
lngTrID is a variable passed in with Open Args

If DCount("[TrID]", "qChkChosenTrack", strCriteria) > 0 Then
'yes chosen track is in the combo's list
Me.cboTrID = lngTrID
Else
'drop down the track combo
Me.cboTrID.SetFocus
Me.cboTrID.Dropdown
End If

Jeanette Cunningham

Bill said:
The box stays correctly positioned, but the expanded
portion is disjointed from the combo itself. As a stretch,
I wondered if the positioning coordinates got messed up
and might show up if I captured them in a Debug.Print.
Nothing seems disturbed:

(Form_Load) Before DropDown
Left: 11100
Right: 960
Width: 1800
Height: 300
(Form_Load) After DropDown
Left: 11100
Right: 960
Width: 1800
Height: 300

Bill
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top