Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
Password Reminder
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old January 4th, 2005, 08:20 PM
Registered User
Join Date: Jan 2005
Location: rijkevorsel, antwerpen, Belgium.
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Search in a sub form

Hello (sorry for my writhing errors my English is not so good)

I like to make a search form,

In this search form is a sub form, in this sub form is a query that selects every customer of the company I work for.

My problem is I like to make it so that I can search in the sub form by standing in the desired column and typing the value that I desire.

Sort of a list box but in a list box you can only search for the first letter example:

-My name “Steve”
If I stand in the list box that is selected on the first name of a customer and type “s” I get everyone with an “s” but after the “s” I type a “t” and get everyone with a “t”. (not “st”)

If I use a combo box the problem is solved, but you can not select another column.
(Or you have to hide it)

(The two statements are correct I hope, if not correct me please.)

So I’d like to have a sub form and by standing in the desired column and then typing the needed result.


In the sub form customers there are 2 columns: “Name” and “Address”

1. if I need a search for a name I stand in the column Name and type “steve” and automatically I go to every customer with the name “steve”

2. if I need a search for an address I stand in the column address and type “België” en get every customer with an address in ”België”

End so on (? in Dutch it’s ‘en zo voort :D’ )

The reason for my question is if seen it work and it works fantastic but I never get to now how they managed to make it?

So if you now how to make it please help me.
I’ve had this question for almost a year.

Steve m

Reply With Quote
  #2 (permalink)  
Old January 7th, 2005, 08:30 PM
Authorized User
Join Date: Jul 2004
Location: lagos, ikeja, Nigeria.
Posts: 34
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via ICQ to chipset Send a message via MSN to chipset Send a message via Yahoo to chipset

why using a list-box?
why not try a text-box?

well this is the code for the search program


vb 6.0
textbox----------Name it txtName
DataGrid---------Name it dtgShow

create an Access file,(A table) and Feilds
    Name the table 'Employee' and Name among
    your other feilds 'Employee Name'

Public Sub txtName
    On Error Resume Next
    Dim SQLstm$
    Dim sName$
    Dim Db_Rec as Recordset

        sName = "'%" & txtName & "%'"

    SQLstm = "SELECT * FROM Emloyee WHERE [Employee Name] LIKE " & sName
    Set Db_Rec = New Recordset

    Db_Rec.Curlocation = 3
    Db_Rec.Open SQLstm,[Connection to a Database],2,3

    set dtgShow.Datasource = Db_Rec

End Sub

hope it works

Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Search Form? scandalous Access 8 February 8th, 2007 09:01 AM
Search for a record using a form a_wahab Access 6 September 1st, 2006 12:03 PM
Search Controls on a Form donnie_darko1983 ASP.NET 1.0 and 1.1 Basics 2 April 12th, 2005 05:20 AM
Search Form ksa266 Access VBA 2 December 29th, 2003 06:37 AM
Problem with Search Form DRuiz VB Databases Basics 3 June 6th, 2003 11:16 AM

All times are GMT -4. The time now is 01:16 AM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.