PC Review


Reply
Thread Tools Rate Thread

Display First Record from Combo Box

 
 
justin.poole@gmail.com
Guest
Posts: n/a
 
      1st Sep 2006
How can be tell the form to display the first record that is
in a combo box when the form opens?

Software: Access 2002

 
Reply With Quote
 
 
 
 
Dirk Goldgar
Guest
Posts: n/a
 
      1st Sep 2006
<(E-Mail Removed)> wrote in message
news:(E-Mail Removed)
> How can be tell the form to display the first record that is
> in a combo box when the form opens?
>
> Software: Access 2002


I'm not sure at what point the combo box's list is populated, compared
to the loading of the form. You could try something like this air code:

'----- start of untested air code -----
Private Sub Form_Load()

With Me!cboMyCombo
If .ListCount > 0 Then
Me.Recordset.FindFirst "IDField=" & .ItemData(0)
End If
End With

End Sub
'----- end of untested air code -----

That assumes that the ID field in the form's recordsource is numeric.
If it's text, we'd need to add quotes to the FindFirst criterion.

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)


 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
RE: combo box display current record value Ray Microsoft Access Form Coding 0 23rd Jul 2009 10:29 PM
Record doesn't display in combo Peter Stone Microsoft Access Forms 1 3rd May 2009 06:37 AM
Display record in a combo box ggerke Microsoft Access VBA Modules 2 30th Sep 2008 08:07 AM
Selecting which record Combo box will display sharontodd Microsoft Access VBA Modules 2 18th Jul 2008 01:56 AM
Combo Box - Display value of current record ToniS Microsoft Access 0 28th Jan 2008 10:37 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:31 PM.