Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations dencom on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Combobox dropdown last record in form

Status
Not open for further replies.

phpatrick

Programmer
Jul 9, 2006
72
BE
Code:
    Me!refSHIFT1.SetFocus
    Me!refSHIFT1.Dropdown

This code dropdown a combobox. However, I use a continious form, where the combobox is multiplied for more records. He always dropdown the combobox on top en not the last added record. How can I say that he need to select the last one ?

regards
 
How are ya phpatrick . . .

The combobox for the [blue]currently selected record[/blue] should be the one to dropdown. Try:
Code:
[blue][purple][b]Me.Recordset.MoveLast[/b][/purple]
Me!refSHIFT1.SetFocus
Me!refSHIFT1.Dropdown[/blue]

BTW: is the combobox [blue]bound or unbound?[/blue]

Calvin.gif
See Ya! . . . . . .
 
I give it a try, I test it.
the combobox is bound (with a reference key)

bye, see you
 
yep, with a little help from my friends, ITS WORKS !
 
I think a little bit further.
It can be the last one, but not necessary.
The user clicks his record in an ad random order.
In other words it should be the currently selected record.
.MOVELAST is not the best option in this case. I should use code to mention the selected record.
I do some trial and errors, but if you know let me know...
 
phpatrick . . .

I believe your fighting an [blue]operational problem[/blue] here. Your origional code will do what you want,
Code:
[blue]the user has to select the record of interest first![/blue]

The question is . . . [blue]how are you triggering the code?[/blue]

In any case try this in the [blue]Got Focus[/blue] event of the combobox:
Code:
[blue]   Me![purple][b]ComboboxName[/b][/purple].Dropdown[/blue]

Calvin.gif
See Ya! . . . . . .
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top