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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Searching and displaying data in Access.

Status
Not open for further replies.

enviroman

Technical User
Aug 7, 2006
1
US
Hello,

I am new to this site (and somewhat new to Access).

I have a database with basic information (names, addresses, etc). I created a form to enter data into my database. Now I want to create a search function to find and display the results in some sort of GUI form (the form function is fine!).

Is there a way to do this?

I created a Query-By-Form but the results are just a list of data in the database format. Is there a way to display this data in a "nicer" way? I just want the user to be able to search for a name and have the DB entry including the address/phone number, etc display when they do the search.

Thanks!

Tom
 
sort of GUI form" ? what are you talking about?

Is there a way to display this data in a "nicer" way? Could you be more specific? Colors, flowers ???

Create on your form an unbound combobox. Place on the
Rowsource of the combobox:
SELECT DISTINCT [LastName] FROM TableName ORDER BY [LastName];

Then on the AfterUpdate event of the combobox place:
Private Sub ComboboxName_AfterUpdate()
Dim R As DAO.Recordset
Dim SQLText
Dim holda As Integer
SQLText = "Select * From [TableName] Where [LastName] = " & Chr(34) & Me![ComboboxName] & Chr(34)
Forms![TheFormName].RecordSource = SQLText
Me![ComboboxName] = Null
End Sub

Substitute your field names and table names.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top