Need help to find right solution

P

Piotr

Hi I cant find the right way to complete my task.

I have customer table in acces, about 800 records (can be exported to
txt, xml excell, whatever).

Then I need to create a form, to let user easily choose the customer
and add some data to another field. And there is the problem. I cant
find a way to easily choose the customer. List field doesnt work well
as it takes time to find customer, any searching coul be done but it
needs separate worksheet.
I was wandering if I could do for example searching customer in another
worksheet with button near every record "Add" so user can add position
to primary worksheet.

any hel or ideas higly appreciate
regards
Peter
 
M

Mark Lincoln

I have this code on a form that provides a record view of my data. It
looks for text in a textbox on the form called txtFind and compares
that text (which can be entered in all lowercase) with the cells in the
sheet in which I have last names. This should provide you with a basis
for coding your own search.

Private Sub FindName()
Dim x As Integer, SearchStr As String, NameBit As String,
NameNotFound As Boolean
NameNotFound = True
If txtFind <> "" Then
SearchStr = UCase(txtFind)
For x = 2 To 118 ' rows containing my data; change to suit
' my last names are in column 3; change to suit
NameBit = UCase(Left(Cells(x, 3).Value, Len(SearchStr)))
If SearchStr = NameBit Then
NameNotFound = False
R = x ' R (dimmed at top of form code) designates which
' row of the sheet to use when populating form
PopulateForm ' calls my form-filling-out code
txtFirstName.SetFocus ' sets the focus on my form
Exit For
End If
Next
If NameNotFound Then
x = MsgBox("No match found for '" & txtFind & "'", vbOKOnly, "No
Match")
End If
txtFind = ""
Else
x = MsgBox("You want me to guess who to search for?", vbOKOnly,
"Find What?")
End If
End Sub
 

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