selhamawy wrote:
hello,
I need someones expertise...
i am the only part-time developer at a start up college now.
question is
i am using Access 2003
and creatng a form with a combination of queries, tables and subforms.
How do I create a parameter.
I know how to create one in a query but one is needed in the form. If i
can avoid the query that would be fine but i do not think that is
possible.
the information is to get employee information
the parameter is for the employee last name
i am using
Employee ID
first
last name
position
address
phone
mobile
other stuff
I would appreciate to help me as soon as u can.
The thread "excluding records from a query" in my newsreader is the
message just before yours. This may answer your question.
Basically, I like having a full blown query as the recordsource of the
form. I can then open the form with a filter.
Docmd.Openform "FormName",,,"Id = " & Me.ID
or when the form opens I can filter the records. In your case I may
have a combo box (if the list will contain less than 1000 records)
listing the EmpID, EmpLast, and EmpFirst. In the AfterUpdate event I
can enter
If Me.EmpID <> 0 Then
Me.Filter = "EmpID = " & Me.ComboEmp
Endif
Me.FilterOn = (Me.EmpID <> 0) 'sets to true or false
One last thing, I see you have a field called "last name". If I wanted
a pain in the ass, I would use spaces in field names, table names, query
names, etc. If I wanted simplicity, I would not use spaces. I usually
name fields with a capital as the first character of each word. Ex:
lastname becomes LastName. I then can reference easily with the name,
not having to type [] brackets around everything.