search form.plz help!!!

ih8code

Registered User.
Local time
Today, 07:18
Joined
Feb 19, 2014
Messages
15
Hello.I want to create a search form for a database.The database is simple.It has three tables (employees,departments and company).the fields of the employees table are:first name,last name,internal phone,department and floor.
I want to use this db to search for internal phones but i dont know anything about coding except from basic sql queries.I found some macros and i used them to make the search field but its very simple and also it gives me only one result in the form.i want to see all the results together(subform?)Can someone help me by writing the code for me or at least give me a link of something similar please?Thanks in advance
 
So you want a list of "Internal Phone numbers" from the Employee Table?
 
Yes!I did myself though :) i found the code for the search button and i made the form.It is a continuous form.One thing i can't find now is how to make the form show no data at all when i open it.Because when i open the form i get all the data from the table until i use search.Is there something in the form properties or i have to write code to do this?Thanks
 
>>>Is there something in the form properties or i have to write code to do this?<<<

No.. If the records are there it will show them.

I can think of two ways to stop the records showing but neither would suit your situation.

You could create an sql string in the calling form, that selects the records you want to show and pass that to the called form's record source when you open it.

Or you could set a filter in the called form ...
 
so i could make a filter on load like "where first_name="adfvearg" so it returns nothing,but will the search field work then? and if it will can you please tell me the syntax of the filter on load property?or i have to make an sql query and just right the name of the query in the property field? thanks
 
I can't help you with filters.. I seldom use them. Someone else may if you post a separate question.
 
When you open a Form you can do this:

Code:
Function Originals_DialogueCosts()
    With CodeContextObject
        DoCmd.OpenForm "Originals Dialogue Costs", acNormal, "", "[Orig Cost Old Stock]= " & .[Orig Old Stock], acFormEdit, acWindowNormal
    End With
End Function

Simon
 

Users who are viewing this thread

Back
Top Bottom