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

Search strife..

Status
Not open for further replies.

thetambarineman

Technical User
Feb 29, 2000
63
GB
Hello all,

Im having a few problems with how i should carry out a procedure.. i have a search form.. something similiar to the one found in Windows 9x/NT the thing is this search form is searching for records in a database.. held on a seperate form.... the results from the search are displayed in a list box. Can anyone suggest a way in which i could program it so that when i click on a certain record held in the list box-it goes to the corresponding record in the database..

Thanks in advance..
 
Do you mkean that the the second form (not the search form) displays one record at a time (from the database)??

If this is what you mean, I would set up a Public Sub / Function in the second form (I usually call this Show_Form) which accepts one argument. When this is called, it does a look up on the database and completes the form (and calls the Show method of the form to make it visible). Then, when you click on the item in the list box, call the sub / function passing the ID of the record that you want to display.

If you need a code example let me know.
Simon
 
Not sure what you mean..
The search form is seperate from the Employer form.. when the user does a search-he she enters a value - say Microsoft
the data is then checked against the database. Any matching values are displayed in a list box - on a separate search form. The nnext bit is the bit that i need help with..

When u click on the list box i was hoping to be able to take the user to the searched for record.

so say the user has searched for

IBM then Microsoft afterwards

i want to be able to go back to IBM and click on it-and go to that record..

A code example would be helpful...

Thanks again...

Paul...
 
When you open your search form, open it modally.
On the search form, when the user clicks the list box, transfer the Id of the record which was select to a property on the search form. When the user clicks OK or Cancel, Hide the Search Form which will return you to the calling module. Then you simply need to evaluate the property on the search form and go and retrieve the record in your data retreival module.
 
I use a flex grid to display the records that meet my search criteria. Then I double click on the row selected, and click a command button (View Record) which displays the
detail information on a update,delete form.

RayMan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top