Searhcing inside a database

jonnybinthemix

New member
Local time
Today, 20:08
Joined
Oct 13, 2004
Messages
5
Hi guys

i have written a very simple database and i have a form called frm_search.

On this form i have nothing at the moment, but what i want is:

  • Surname
  • Operating System
  • Network Socket
  • Telephone Sock

Under each section i would like a txt box and a button, i want to enter a surname in the surname box ad press search and for it to find that surname in my database. and so on for each of the search fields.

For example, if i want to know who is attached to network socket 177 i can enter 177 into the search field and press search and it will bring up the details of the person who is attached to that network socket.

Is this possible and can it be done easily?

Please could you keep things as simple as possible because i am a beginner :)

Thankyou

Jon
 
Jon,

There are also other samples in the Sample Database forum here.

Also use the Search Facility and look for "Search".

Wayne
 
hi mate,

What you have writted there is ideal and looks perfect, but im having great dificulty integrating it nto my database :(

This is my database..........

how would i use your code in my database?

Autid.zip
 
First thing you need to do is learn relationships. From there creating a search engine is fairly simple.

Dave
 
Check out the relationship structure, then the search function.

Dave
 

Attachments

jonnybinthemix said:
Is this possible and can it be done easily?

Please could you keep things as simple as possible because i am a beginner :)

Thankyou

Jon
It depends how you want the information and what you want to do with it. If you just want to see it. Do a report.

DoCmd.OpenReport "ReportName", acPreview, , "networkSocket = '" & txtnetworkSocket & "'"

where txtNetWorkSocket is the textbox

You can even have many textboxes and do

checkNetworkSocket = Null
If isnull(txtnetworkSocket) = False and txtnetworkSocket <> "" Then
checkNetworkSocket = " AND networkSocket = '" & txtnetworkSocket & "' "
End IF

checkSurname = Null
If isnull(txtSurname) = False and txtSurname <> "" Then
checkcheckSurname = " AND Surname = '" & txtSurname & "' "
End IF

DoCmd.OpenReport "ReportName", acPreview, , "isNull(anyField) = false" & checkNetworkSocket & checkSurname

txtSurname etc... are the textboxes
checkSurname etc...is a variable
Surname etc...is the field

If you want to edit the data: Have a combo bo with the surname or network socket etc... Then afterupdate, do the following:

RecordsetClone.FindFirst "Surname = '" & ComboSurname & "'"
Bookmark = Me.RecordsetClone.Bookmark
 
i think im starting to understand this!! :)

Old Soft boss: Thats EXACTLY what i was trying to do :) Ive looked at your code, and its starting to make sence, but the only thing is, now when i view a computer it comes up with #name? in the drop down fields.

How do i get that back to normal?
 
In the properties of your drop down box there is a property called "Row Source" When you click in this field, a little box with 3 dots on it will appear. Click on that and build the row source as you would a query.

It will appear something like

SELECT tblDepartments.DepartmentID, tblDepartments.Department FROM tblDepartments ORDER BY tblDepartments.Department;

Remember how many fields you have and update the column count back in the combo box properties. Then in the column widths, set the first to 0 (to hide the ID field)

HTH

Dave
 

Users who are viewing this thread

Back
Top Bottom