Me.Combo180.dropdown

  • Thread starter Programmer - wannaB
  • Start date
P

Programmer - wannaB

Any help would be greatly appreciated!!
I have a drop down box that users forget to select from before printing a
report, So I set it as index tab 0 and applied Me.Combo180.dropdown to the
onfocus control. Now when the form opens a dropdown box opens in the bottom
right corner for the selection box which is in the upper left corner... OH
and if I click away from the selection box and then click back on is the
dropdown opens right where it should, below the selection box... This only
happens when the form is first open, I'm assuming it has something to do
with timeing...

How can I attach the dropdown list to the selection box, so that is always
opens below or above the selection box.
 
W

Wayne-I-M

Try changing the code to the onLoad -

Private Sub Form_Load()
Me.Combo180.SetFocus
Me.Combo180.Dropdown
End Sub

Better still put a message and cancel on the print option if the combo has
not been selected (is null)

Also rename the combo to something that means something to you. If you have
lots of controls with just numbers it can get a little difficult to step
through codes. - just a thought
 
P

Programmer - wannaB

Thanks Wayne, but I've tried that and it produces the same results, the list
pops up somewhere other then right where the combo is.
I've also tried this code; (below) and it seemed very odd but as I steped
through it, even though the value of Combo180 was displayed as Null in the
locals view it would go right by it as though I had coded it wrong...
'Private Sub Combo180_LostFocus()
' If Me.Combo180.Value = Null Then ' not able to get this to work
' MsgBox "You Must Select a Package, First", vbOKOnly, "Selection
Empty"
' Forms!fCountry!Combo180.SetFocus
' Else
' MsgBox "OK it worked", vbOKOnly, "Selection Empty" ' for testing
' Resume Exit_Command182_Click
' End If
'End Sub

It just occured to me to try it under a different control property.

any other ideas

as for the naming conventions used, this is an inherited application, and
there's a long way to go yet... thanks for the thoughts
 
W

Wayne-I-M

Try this

If IsNull([combo180]) Then


try making a copy of the form then delete the combo from the copy. use the
wizard to recreate the combo and see if you get the same problem
 
B

Bob Quintal

=?Utf-8?B?UHJvZ3JhbW1lciAtIHdhbm5hQg==?=
Thanks Wayne, but I've tried that and it produces the same
results, the list pops up somewhere other then right where the
combo is. I've also tried this code; (below) and it seemed very
odd but as I steped through it, even though the value of Combo180
was displayed as Null in the locals view it would go right by it
as though I had coded it wrong... 'Private Sub
Combo180_LostFocus() ' If Me.Combo180.Value = Null Then ' not
able to get this to work ' MsgBox "You Must Select a
Package, First", vbOKOnly, "Selection Empty"
' Forms!fCountry!Combo180.SetFocus
' Else
' MsgBox "OK it worked", vbOKOnly, "Selection Empty" '
for testing ' Resume Exit_Command182_Click
' End If
'End Sub

It just occured to me to try it under a different control
property.
The best place to put this code in the On_Click event of the button
that opens the report, and bypass the report opening if the combobox
is empty.

any other ideas

as for the naming conventions used, this is an inherited
application, and there's a long way to go yet... thanks for the
thoughts
 
P

Programmer - wannaB

Thanks again Wayne-I-M, that worked..

Wayne-I-M said:
Try this

If IsNull([combo180]) Then


try making a copy of the form then delete the combo from the copy. use the
wizard to recreate the combo and see if you get the same problem



--
Wayne
Manchester, England.



Programmer - wannaB said:
Thanks Wayne, but I've tried that and it produces the same results, the list
pops up somewhere other then right where the combo is.
I've also tried this code; (below) and it seemed very odd but as I steped
through it, even though the value of Combo180 was displayed as Null in the
locals view it would go right by it as though I had coded it wrong...
'Private Sub Combo180_LostFocus()
' If Me.Combo180.Value = Null Then ' not able to get this to work
' MsgBox "You Must Select a Package, First", vbOKOnly, "Selection
Empty"
' Forms!fCountry!Combo180.SetFocus
' Else
' MsgBox "OK it worked", vbOKOnly, "Selection Empty" ' for testing
' Resume Exit_Command182_Click
' End If
'End Sub

It just occured to me to try it under a different control property.

any other ideas

as for the naming conventions used, this is an inherited application, and
there's a long way to go yet... thanks for the thoughts
 

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