Rabu, 05 Oktober 2016

Re: [MS_AccessPros] Combo Box finds first record in table instead of selection

 

John,

Thanks for your reply. I found the problem. I had an incorrect join in the query for the record source of the form. I was trying to look up a trailer that had not been delivered yet and my record source had an inner join between the primary table and the delivery table. So the combo box could find the record because it was just based on the primary table but the query couldn't because of the join. I changed it to a left join and now it works. Hope things are good in Paris. Having you done any traveling lately?

Doyce



---In MS_Access_Professionals@yahoogroups.com, <JohnV@...> wrote :

Doyce-

What is the Row Source of the combo box, the Bound Column, Number of Columns, and the Display Widths?

John Viescas, Author
Effective SQL
SQL Queries for Mere Mortals 
Microsoft Access 2010 Inside Out
Microsoft Access 2007 Inside Out
Microsoft Access 2003 Inside Out
Building Microsoft Access Applications 
(Paris, France)




On Oct 5, 2016, at 9:30 PM, winberry.doyce@... [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com> wrote:




Hello Friends,

I have a combo box that is supposed to find the record for the trailer typed into the box. However if you type in the unit number, it displays the first record in the table. Here is the code in the afterupdate event of the combo box:

Private Sub cboLookupTrailer_AfterUpdate()
    ' Find the record that matches the control.
    Dim rs As DAO.Recordset
    Dim strComboVar As String

    strComboVar = Me.cboLookupTrailer

    If Len(cboLookupTrailer & vbNullString) <> 0 Then
        Me.Filter = ""
        Me.FilterOn = False
        Me.Recordset.FindFirst "[New Unit #]='" & strComboVar & "'"
        
    End If
End Sub

I fear corruption. I have tried compact and repair and also deleting the combo box and recreating it. No luck. Anyone have any ideas?

Doyce




__._,_.___

Posted by: winberry.doyce@con-way.com
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (5)

Have you tried the highest rated email app?
With 4.5 stars in iTunes, the Yahoo Mail app is the highest rated email app on the market. What are you waiting for? Now you can access all your inboxes (Gmail, Outlook, AOL and more) in one place. Never delete an email again with 1000GB of free cloud storage.


.

__,_._,___

Tidak ada komentar:

Poskan Komentar