combo box display current record value

  • Thread starter gmazza via AccessMonster.com
  • Start date
G

gmazza via AccessMonster.com

Hey there,
I am having a minor problem.
I have an unbound combo that selects all Trademarks from the Trademark table.
The Trademark table has 1 column, Trademark.
In the same form, (no subform), I have a column called Trademark.
The recordsource of the form is Trademark.
AfterUpdate of the combo box I have this:
If Not IsNull(Me!cboTrademark) Then
Me.Recordset.FindFirst "Trademark = '" & Nz(Me![cboTrademark], "") & "'"
End If

Problem is this:
When I use the navigation buttons on the bottom of the screen, the Trademark
gets updated to the next record in the table, however, the combo box sits
there saying an old value.
How can I get the combo box to say the same record that the Trademark says
when I use the nav buttons to goto a new record?
I tried making the combo box bound to the Trademark but that does not work.
Thanks!!
 
R

Ray

Try this...

Private Sub Combo1_AfterUpdate()
Me.Recordset.FindFirst "Trademark = '" & Combo1 & "'"
End Sub

Private Sub Form_Current()
If Combo1 <> Trademark Then
Combo1 = Trademark
End If
End Sub
 
G

gmazza via AccessMonster.com

Worked great! Thanks Ray!
Try this...

Private Sub Combo1_AfterUpdate()
Me.Recordset.FindFirst "Trademark = '" & Combo1 & "'"
End Sub

Private Sub Form_Current()
If Combo1 <> Trademark Then
Combo1 = Trademark
End If
End Sub
Hey there,
I am having a minor problem.
[quoted text clipped - 15 lines]
I tried making the combo box bound to the Trademark but that does not work.
Thanks!!
 

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