Form Display

  • Thread starter Thread starter LindaBee
  • Start date Start date
L

LindaBee

How do I open a form in query mode, so that no records are displayed until I
do a search. I have looked at filter and it does not work as I want it too.
Please experts help.
 
If I do not specify data source then my fields all get Name# in them and I
can't do a search. I want to be able to search. Any other way?
 
I was assuming that you can some way of allowing the user to specify a
Filter, and that you're set the RecordSource, Filter and FilterOn properties
at that time.

How do you intend to do the search? If you're hoping to use the Find and
Replace dialog, then your data must be there in advance.
 
Douglas thanks for your help and please do not get impatient with me but how
would I get the user to specify a filter. I am ne to access and this is my
first project
 
As I asked before, how do you intend to do the search?

One option is to put a control (or controls) on the header of the form.
Let's assume you have a single textbox called txtName and you intend to
allow the user to type in part of the customer's name. Let's further assume
you have a button called cmdFind that the user is supposed to click on once
he/she has entered the value in txtName. You'd use code like:

Private Sub cmdFind_Click()

If Len(Me.txtName & vbNullString) > 0 Then
Me.RecordSource = "qryCustomerInformation"
Me.Filter = "CustomerName Like ""*" & Me.txtName & "*""
Me.FilterOn = True
End If

End Sub
 
Back
Top