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 Button

Status
Not open for further replies.

kevinnaomi

IS-IT--Management
Sep 26, 2002
81
US
I have a simple form. A Text box, which displays the computer name, a drop down box which displays the floor and another drop down box that displays the seat.
I want to create a search button that I can enter the name of the computer I am looking for, and the record for that computer will appear.

I want to do this for like an inventory situation. If a computer changes position, I want to search for that computer name and change the floor and seat number..

Would anyone have any ideas on how this could be accomplished??? PLEASE...
 
Hi

I assume it is a bound form with a table or query which provides the list of computers, and that each computer has a uniqueId ?

Given that you probably have a relatively small number of computers (ie not several thousand), a reasonable way to do this would be to place a combo box on the form, the combo box should be based on a query on the 'computers' table. This query should include enough columns to allow you to visually identify the PC you are interested in, the first column on the left should be the unique Id

In the after Update event of the combo box put code so:

Me.RecordsetClone.FindFirst "ComputerId = '" & cboComputerId & "'"
If Me.RecordsetClone.NoMatch Then
Else
Me.Bookmark = Me.REcordsetClone.Bookmark
End if

or if the ComputerId column is not a string

Me.RecordsetClone.FindFirst "ComputerId = " & cboComputerId
If Me.RecordsetClone.NoMatch Then
Else
Me.Bookmark = Me.REcordsetClone.Bookmark
End if

Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - UK
 
I created the form using the wizard. I selected the table I had, with pc name, floor and seat columns.
I then changed the floor and seat boxes to drop down boxes and specified the source locations as the relevant columns.
This all works fine.
But as I have 500 computers over 3 floors, I want to be able to input the number of the pc I am looking for, in a separate text box if required, press a search button, and have the record for the PC I inputted show up. At this point I want to be able to use the drop down boxes to change either the floor or seat info...

I am sorry, but I don`t understand about bound and unbound boxes....
 
Hi

1. if you created the form in the way you say, you have a bound form

2. if you use a combo box as I suggested, you can EITHER choose from the list, or Type in a PC id, that is why it is called a combo box (ie it combines a text box and a list)

Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - UK
 
I tried changing the pc name text box to a combo box, but when I typed the name of the pc I was looking for in the combo box, it didn`t do anything....

I am guessing that I did something very wrong....

I appreciate your help more than the english language can explain.
 
Hi

I did not say CHANGE any control, I said "to place a combo box on the form" ie ADD a combo box

Which version of Access are you using?

If you wish EMail a zipped copy of your databse to kenneth.reayREMOVETHISBIT@talk21.com and I will show you what I mean, it is easier to do than to explain (note I can only do this if it is Access2000, I am on an Acecss2000 site at present)


Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - UK
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top