search name with first letter

H

Hidy

Hello there,

I had used combo box to list the customer name which i can do update and
delete of the record. The problem is I have over 170000 data and the combo
box is only limit to 65535 records only. I suggest to do separete combo box
listing where i can group each combo box for example (A-C) (D-F). I don't
know how to list the name base on first letter. Eg:-
select CustName from Customer where CustName=(i don't know this part where i
can have name with beginning letter A,B,C).

Thanks.
 
D

Dennis

Sorry, further to my last post it should be like this
where CustName Like "A*" Or CustName Like "B*" Or CustName Like "C*"
 
A

Allen Browne

Perhaps you could put an option group with 26 toggle buttons above the
combo: A - Z, with the values 1 to 26. Then in the AfterUpdate event
procedure of the option group, set the RowSource of the combo so it is
loaded with that letter only.

Example:

Private Sub Frame3_AfterUpdate()
Dim strWhere As String
strWhere = "[CustName] Like """ & Chr(Nz(Me.Frame3, 1) + 64)) & "*"""
Me.Combo4.Value = Null
Me.Combo4.RowSource = "SELECT CustID, CustName FROM Customer WHERE " &
strWhere & " ORDER BY End End Sub

There's an example of such a form in the Northwind sample database.
It's called Customer Phone List.
 

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