Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms / December 2007

Tip: Looking for answers? Try searching our database.

Search Form

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Fie - 17 Dec 2007 15:11 GMT
Hi,

Iam currently trying to develope a search form (frmSearch) that a user
types a value into a text box and it then searches the table
(tblCounrty) and the results are displayed in a list box. I have
attached the query to the list box but I have totally forgot the code
to put behind the search button and also behind the listbox so when
the correct entry in the list box is double clicked the results are
opened up on a results form (frmResults).

can someone help me

Fiona
Klatuu - 17 Dec 2007 15:39 GMT
All you need to do is requery the list box:

   Me.MyListBox.Requery
Signature

Dave Hargis, Microsoft Access MVP

> Hi,
>
[quoted text clipped - 9 lines]
>
> Fiona
Fie - 17 Dec 2007 15:43 GMT
What do you mean?
Klatuu - 17 Dec 2007 15:55 GMT
I guess I only answered half the question.  The code I posted previously goes
in the Click event of the search button.

In the Double Click event of the form, use the value selected in the list
box to open your form to the selected record:

   strSearch = Me.MyListBox
   Docmd.Openform "frmSearch", , ,"SomeField = " & strSearch

The above syntax assumes SomeField is numeric.  If it is text:
   Docmd.Openform "frmSearch", , ,"SomeField = '" & strSearch & "'"

Signature

Dave Hargis, Microsoft Access MVP

> What do you mean?
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.