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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Set initial value on a 'filtered' combobox 2

Status
Not open for further replies.

flugh

Technical User
Aug 23, 2002
655
US
Greetings!

I have a combobox with a pk_id (hidden) and name of employees. I have a filter on the source query to only return the 'active' employees. My problem is how do I set the initial load value of this combobox to the first record returned by the query? I can't put 'pk_id = 1' in the form load event, as the employee with pk_id=1 isn't always valid/active/just plain filtered out. I'm more than happy to google something up, but everything I find boils down to 'default = 1' (which isn't always valid). Can I access the recordset in such a way that I get the 'relative first record' rather than 'record = 1'?


----
JBR
 
Try something like this:

[tt]me!mycombo.value=me!mycombo.itemdata(0)[/tt]

Roy-Vidar
 
Hey, thanks a bunch! That fixed it right up. Trying to clean up all those little 'quirks' (all those little error messages that I understand and can cope with, but my replacement is alarmed by) before I leave out at the end of the month. That was a one of my biggest gripes about the payroll form.

Thanks again :-D

----
JBR
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top