OK,
Would you post the code for your FIND button?
Rather than use FIND, it is easier to filter the recordset.
Like Klatuu said, you could put an unbound text box in the header of the
form and add two buttons. One button would set the filter and the other would
remove the filter.
If [DDLID] is numeric and the text box in the header is named "Text8", the
following code will show only records that match what is entered in the text
box:
(Change Text8 to the name of your text box)
' filter records
Private Sub SetFilterOn_Click()
Me.Filter = "[DDLID] = " & Me.Text8
Me.FilterOn = True
End Sub
' remove the filter
Private Sub SetFilterOff_Click()
Me.FilterOn = False
End Sub
If [DDLID] is text, use the fillowing code:
'filter records
Private Sub SetFilterOn_Click()
Me.Filter = "[DDLID] = '" & Me.Text8 & "'"
Me.FilterOn = True
End Sub
HTH
--
Steve S
--------------------------------
"Veni, Vidi, Velcro"
(I came; I saw; I stuck around.)
Jen said:
This in not what I am looking for. When I and the ' it only searches the
current record. I want it to search all my records but only the field
[DDLID].
I am not sure how to set the Focus to [DDLID] because when the form opens
[Caller] is the first field to be filed out.
Thanks
Jen
SteveS said:
Jen,
Are you saying that if you set the focus to [DDLID], the focus moves to
[Caller], then finds records?
If so, change this line - add a single quote at the front (ie - comment out
the line)
' Screen.PreviousControl.SetFocus
^
Then try the code.
HTH
--
Steve S
--------------------------------
"Veni, Vidi, Velcro"
(I came; I saw; I stuck around.)
:
On my main form I have a command button for the function Find Records.
However I want it only to search one field.
Screen.PreviousControl.SetFocus
DoCmd.DoMenuItem acFormBar, acEditMenu, 10, , acMenuVer70
When I click on the command button it wants to search [Caller]
I want it only to search [DDLID] everytime. Is this possible.
Thanks Jen