Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Controls

Status
Not open for further replies.

Bigpapou

Programmer
May 23, 2001
41
CA
Hi,
I have a form in wich you enter a first and a last name. Now if the 2 are not isNull(), there should be only one entry so I search for it and bingo.

Now, if one of them isNull() then there could be more then one entry so I wanna open another form with a scrollingdown list box()(sorry but... dunno how to call those in english) in wich the user will find all the choices associated with the first or last name he entered.

As an example:let's say you're searching for Bob Dylan. You enter Bob in the "firstName" box and click the GO button... then the other form pop's up and ask you to choose from the list:

Bob Clark
Bob Dylan
Bob Binette...

How to do that???
I've read the "AddItem(Text, Index)" method but I don't quite understand.
!!!Any help would be appreciated!!!
 
Hello Here is my solution to this problem.
1- Create 1 combo box and 1 list box and a option button that says to the user that this is the last name search or this is the First Name search.

2- Type in the First or Last name in the combo and select the option box to indicate that this is a first or last name.

3- click Go , it will send a SQL statement to the List box .recordset and make it Visable.
sending the sql statement to the recordset and requery the list box and make it visable.

Good Luck
Michael Vick
 
Create a PUBLIC procedure on the second form which is called from the GO button.
(Formname.Procedure(Me.FirstName, Me.Lastname)

The procedure should be something like....

Public Sub (Optional Firstname As String, Optional Lastname As String)

If Nz(Firstname) <> &quot;&quot; And Nz(LastName) = &quot;&quot; Then
Me.listbox.RowSource = &quot;Select Lastname from
where firstname = &quot;&quot;&quot; & Firstname & &quot;&quot;&quot;;&quot;
ElseIf Nz(Firstname) = &quot;&quot; And Nz(LastName) <> &quot;&quot; Then
Me.listbox.RowSource = &quot;Select Lastname from
where firstname = &quot;&quot;&quot; & Firstname & &quot;&quot;&quot;;&quot;
End If

End Sub

Hope this help for you....

Greetings,

Kalin

 
That's exactly what I did.
Thank you anyway Kalin!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top