Hello
I have a combo box(unbound) for the Customer field.
When I select a customer from that, the text box diplays
corresponding AcctNo. My problem is, if a Customer has
more than one account, the AcctNo in the text box doesn't
change.
What I should be doing?
This is the code I wrote:
Private Sub Combo1_AfterUpdate()
' Find the record that matches the control.
Dim Rs As Object
Set Rs = Me.Recordset.Clone
Rs.FindFirst "[CUSTOMER] = '" & Replace(Me!
[Combo1], "'", "''") & "'"
Me.Bookmark = Rs.Bookmark
End Sub
Duane Hookom - 24 Mar 2005 21:01 GMT
The bound column of the combo box must be unique. What is the Row Source of
your combo box?

Signature
Duane Hookom
MS Access MVP
> Hello
> I have a combo box(unbound) for the Customer field.
[quoted text clipped - 16 lines]
>
> End Sub
JSB - 24 Mar 2005 21:10 GMT
It is
SELECT [Find by Company Name].[CUSTOMER] FROM [Find by
Company Name];
'Find ByCompany Name' is the Query name
Thanks.
>-----Original Message-----
>The bound column of the combo box must be unique. What is the Row Source of
[quoted text clipped - 22 lines]
>
>.
Duane Hookom - 25 Mar 2005 03:34 GMT
Apparently you need to include the AcctNo in the Row Source if you expect to
find a particular AcctNo.

Signature
Duane Hookom
MS Access MVP
> It is
>
[quoted text clipped - 35 lines]
>>
>>.
BruceM - 25 Mar 2005 15:33 GMT
I would think that if each customer can have multiple account numbers you
would need an Accounts table, with CustomerID (primary key from the customer
table) as its foreign key. If the main form is based on the Customer table a
continuous subform based on the Accounts table would probably do what you
need.
> It is
>
[quoted text clipped - 35 lines]
> >
> >.
MacDermott - 25 Mar 2005 13:17 GMT
Look at your code.
Doesn't it say "FindFirst"?
So that's what it does; finds the first match.
So, what is your design?
How do you want to signal to the program that it is to find something
besides the first match?
> Hello
> I have a combo box(unbound) for the Customer field.
[quoted text clipped - 16 lines]
>
> End Sub