need help!!! on an access slump..

A

alee

i'm trying to relearn access and i've hit a brick wall.
my table consists of employee name, age, address, years employed. i need to
be able to search the age of employee/s using a textbox (user to input age in
textbox and click ok). i don't know what code to put in. i've tried the
select query but it's not working. basically, user should be able to find all
employees of x age and this info will be populated in a form.
help!
anyone? thanks. i realize this may be simple for most people, but it's been
years since i last used access and i desperately need help!
 
L

Luke Dalessandro

Alee,

Use the form design wizard to create a continuous form from your
table... this will list all employees.

Then, add a text box to the header, mine wound up called Text10.

Add an after update event to Text10:

Private Sub Text10_AfterUpdate()
Me.Filter = IIf(IsNull(Me.Text10), "", "[Age] = " _
& Me.Text10.Value)
Me.FilterOn = True
End Sub

....

There are a billion other ways to do this.

1) You could add the continuous form as a subform somewhere and set its
filter from the main form.
2) You could dynamically bind (Me.RecordSource, Me.Requery) the form to
a SQL statement with a WHERE clause.
3) You could pop this form with a filter from a main form.
4) ...

Luke
(Access 2000)
 
Top