Search button

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Dear Sirs
I would like to create a "Search record" button in my form.
I did it with the wizzard but the it is only searching in terms of
"autonumber" (which is the primary key). I would like to search by familyname.
How can I change that?
 
If the autonumber is tied to the family name, you could use a combo to find
the record you want. There is a combo wizard to do that, or follow the
approach in this article:
Using a Combo Box to Find Records
at:
http://allenbrowne.com/ser-03.html

If you want to be able to search on any field, filtering the form with each
keystroke, you could download the example in this article and import it into
your database:
Find as you type - Filter forms with each keystroke
at:
http://allenbrowne.com/AppFindAsUType.html
 
Hi Allen
thanks for your answer, it's working like you said in principle.
I do have two question concerning your "FindAsUType":
a) I wrote in the property (event) on my form as you instructed for
filtering out each control name. I used quotes arround each contol and commas
to seperate them. - Result: Not filtered, all controll names are still shown.
Any idea to help me?
b) if I write the search name in the text box it stays there until I delete
it with the mouse. Is there any possibility to clear the Textbox with a clear
button?
Thanks
Klaus
 
Re (b), you could put a button alongside the text box, and add the code:
Me.txtFindAsUTypeValue = Null
Call FindAsUTypeChange(Me)

Re (a) you wanted to remove all the controls so they are not listed in the
combo? Did you use the name of the controls (not the name of the fields)?
Post exactly what you used.
 
Dear Allen
Thanks for (b)
For (a) I'll check again and come back tomorrow.
Have a nice evening
Peter
 
I'm to nervous now to stop - so I tried it again.
*I entered the following into the On Load property: =FindAsUTypeLoad (
[Form], "product") - product should be the contol name (if control name and
control source is the same) - It did not work, "product" is still in the
combo box.
* than I tried it with this:=FindAsUTypeLoad ( [Form], "Product") - Product
should be the field name (if field name and Caption is the same) - it didn't
work neither.
I believe if control source and control name are not the same than please
tell me where to find the control name. If they are both the same than I
don't know what I could have done wrong.
Thanks
Peter
 
In form design view, right-click the control you want to suppress, and
choose Properties. On the Other tab of the Properties box, is the Name
property. It is this name you need to use, not the Control Source (which is
what you see in the control on the form.)

Often the Name and Control Source are the same, and that's no problem. But
if they are different, you must use the Name, not the Control Source to
supress filtering of the control.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Amateur said:
I'm to nervous now to stop - so I tried it again.
*I entered the following into the On Load property: =FindAsUTypeLoad (
[Form], "product") - product should be the contol name (if control name
and
control source is the same) - It did not work, "product" is still in the
combo box.
* than I tried it with this:=FindAsUTypeLoad ( [Form], "Product") -
Product
should be the field name (if field name and Caption is the same) - it
didn't
work neither.
I believe if control source and control name are not the same than please
tell me where to find the control name. If they are both the same than I
don't know what I could have done wrong.
Thanks
Peter
Allen Browne said:
Re (b), you could put a button alongside the text box, and add the code:
Me.txtFindAsUTypeValue = Null
Call FindAsUTypeChange(Me)

Re (a) you wanted to remove all the controls so they are not listed in
the
combo? Did you use the name of the controls (not the name of the fields)?
Post exactly what you used.
 
Dear Allen

I entered the following line into the Form property event, it looks like this:
=FindAsUTypeLoad ( [Form], "product_Label")
No chance, I always see the "product" in the combo box.
Do I have to change something else what I maybe forgot?
Thanks
Peter

Allen Browne said:
In form design view, right-click the control you want to suppress, and
choose Properties. On the Other tab of the Properties box, is the Name
property. It is this name you need to use, not the Control Source (which is
what you see in the control on the form.)

Often the Name and Control Source are the same, and that's no problem. But
if they are different, you must use the Name, not the Control Source to
supress filtering of the control.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Amateur said:
I'm to nervous now to stop - so I tried it again.
*I entered the following into the On Load property: =FindAsUTypeLoad (
[Form], "product") - product should be the contol name (if control name
and
control source is the same) - It did not work, "product" is still in the
combo box.
* than I tried it with this:=FindAsUTypeLoad ( [Form], "Product") -
Product
should be the field name (if field name and Caption is the same) - it
didn't
work neither.
I believe if control source and control name are not the same than please
tell me where to find the control name. If they are both the same than I
don't know what I could have done wrong.
Thanks
Peter
Allen Browne said:
Re (b), you could put a button alongside the text box, and add the code:
Me.txtFindAsUTypeValue = Null
Call FindAsUTypeChange(Me)

Re (a) you wanted to remove all the controls so they are not listed in
the
combo? Did you use the name of the controls (not the name of the fields)?
Post exactly what you used.

Hi Allen
thanks for your answer, it's working like you said in principle.
I do have two question concerning your "FindAsUType":
a) I wrote in the property (event) on my form as you instructed for
filtering out each control name. I used quotes arround each contol and
commas
to seperate them. - Result: Not filtered, all controll names are still
shown.
Any idea to help me?
b) if I write the search name in the text box it stays there until I
delete
it with the mouse. Is there any possibility to clear the Textbox with a
clear
button?
Thanks
Klaus


:

If the autonumber is tied to the family name, you could use a combo to
find
the record you want. There is a combo wizard to do that, or follow the
approach in this article:
Using a Combo Box to Find Records
at:
http://allenbrowne.com/ser-03.html

If you want to be able to search on any field, filtering the form with
each
keystroke, you could download the example in this article and import
it
into
your database:
Find as you type - Filter forms with each keystroke
at:
http://allenbrowne.com/AppFindAsUType.html

Dear Sirs
I would like to create a "Search record" button in my form.
I did it with the wizzard but the it is only searching in terms of
"autonumber" (which is the primary key). I would like to search by
familyname.
How can I change that?
 
Peter, what exactly is in the Name property of the combo?

Is it:
product Label
i.e. with a space?

Or does it really have the underscore?

Or is product_Label the name of the label attached to the combo?

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Amateur said:
Dear Allen

I entered the following line into the Form property event, it looks like
this:
=FindAsUTypeLoad ( [Form], "product_Label")
No chance, I always see the "product" in the combo box.
Do I have to change something else what I maybe forgot?
Thanks
Peter

Allen Browne said:
In form design view, right-click the control you want to suppress, and
choose Properties. On the Other tab of the Properties box, is the Name
property. It is this name you need to use, not the Control Source (which
is
what you see in the control on the form.)

Often the Name and Control Source are the same, and that's no problem.
But
if they are different, you must use the Name, not the Control Source to
supress filtering of the control.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Amateur said:
I'm to nervous now to stop - so I tried it again.
*I entered the following into the On Load property: =FindAsUTypeLoad (
[Form], "product") - product should be the contol name (if control name
and
control source is the same) - It did not work, "product" is still in
the
combo box.
* than I tried it with this:=FindAsUTypeLoad ( [Form], "Product") -
Product
should be the field name (if field name and Caption is the same) - it
didn't
work neither.
I believe if control source and control name are not the same than
please
tell me where to find the control name. If they are both the same than
I
don't know what I could have done wrong.
Thanks
Peter
:

Re (b), you could put a button alongside the text box, and add the
code:
Me.txtFindAsUTypeValue = Null
Call FindAsUTypeChange(Me)

Re (a) you wanted to remove all the controls so they are not listed in
the
combo? Did you use the name of the controls (not the name of the
fields)?
Post exactly what you used.

Hi Allen
thanks for your answer, it's working like you said in principle.
I do have two question concerning your "FindAsUType":
a) I wrote in the property (event) on my form as you instructed for
filtering out each control name. I used quotes arround each contol
and
commas
to seperate them. - Result: Not filtered, all controll names are
still
shown.
Any idea to help me?
b) if I write the search name in the text box it stays there until I
delete
it with the mouse. Is there any possibility to clear the Textbox
with a
clear
button?
Thanks
Klaus


:

If the autonumber is tied to the family name, you could use a combo
to
find
the record you want. There is a combo wizard to do that, or follow
the
approach in this article:
Using a Combo Box to Find Records
at:
http://allenbrowne.com/ser-03.html

If you want to be able to search on any field, filtering the form
with
each
keystroke, you could download the example in this article and
import
it
into
your database:
Find as you type - Filter forms with each keystroke
at:
http://allenbrowne.com/AppFindAsUType.html

Dear Sirs
I would like to create a "Search record" button in my form.
I did it with the wizzard but the it is only searching in terms
of
"autonumber" (which is the primary key). I would like to search
by
familyname.
How can I change that?
 
Allen - confusion up 16.

I believe it's better to tell you everything I have and did:

"product_Label" is the label attached to the text box. (property,other,name)
"Producto" is the name of the label (property, format, caption)
"product" is the name of the text box (property,other,name)
"product" is the name of the text box control source (property,data,control
source)

I've tried all of them in your line =FindAsUTypeLoad([Form],"......",etc)
Now you have all but none of them are working. What am I doing wrong?
Peter
Allen Browne said:
Peter, what exactly is in the Name property of the combo?

Is it:
product Label
i.e. with a space?

Or does it really have the underscore?

Or is product_Label the name of the label attached to the combo?

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Amateur said:
Dear Allen

I entered the following line into the Form property event, it looks like
this:
=FindAsUTypeLoad ( [Form], "product_Label")
No chance, I always see the "product" in the combo box.
Do I have to change something else what I maybe forgot?
Thanks
Peter

Allen Browne said:
In form design view, right-click the control you want to suppress, and
choose Properties. On the Other tab of the Properties box, is the Name
property. It is this name you need to use, not the Control Source (which
is
what you see in the control on the form.)

Often the Name and Control Source are the same, and that's no problem.
But
if they are different, you must use the Name, not the Control Source to
supress filtering of the control.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

I'm to nervous now to stop - so I tried it again.
*I entered the following into the On Load property: =FindAsUTypeLoad (
[Form], "product") - product should be the contol name (if control name
and
control source is the same) - It did not work, "product" is still in
the
combo box.
* than I tried it with this:=FindAsUTypeLoad ( [Form], "Product") -
Product
should be the field name (if field name and Caption is the same) - it
didn't
work neither.
I believe if control source and control name are not the same than
please
tell me where to find the control name. If they are both the same than
I
don't know what I could have done wrong.
Thanks
Peter
:

Re (b), you could put a button alongside the text box, and add the
code:
Me.txtFindAsUTypeValue = Null
Call FindAsUTypeChange(Me)

Re (a) you wanted to remove all the controls so they are not listed in
the
combo? Did you use the name of the controls (not the name of the
fields)?
Post exactly what you used.

Hi Allen
thanks for your answer, it's working like you said in principle.
I do have two question concerning your "FindAsUType":
a) I wrote in the property (event) on my form as you instructed for
filtering out each control name. I used quotes arround each contol
and
commas
to seperate them. - Result: Not filtered, all controll names are
still
shown.
Any idea to help me?
b) if I write the search name in the text box it stays there until I
delete
it with the mouse. Is there any possibility to clear the Textbox
with a
clear
button?
Thanks
Klaus


:

If the autonumber is tied to the family name, you could use a combo
to
find
the record you want. There is a combo wizard to do that, or follow
the
approach in this article:
Using a Combo Box to Find Records
at:
http://allenbrowne.com/ser-03.html

If you want to be able to search on any field, filtering the form
with
each
keystroke, you could download the example in this article and
import
it
into
your database:
Find as you type - Filter forms with each keystroke
at:
http://allenbrowne.com/AppFindAsUType.html

Dear Sirs
I would like to create a "Search record" button in my form.
I did it with the wizzard but the it is only searching in terms
of
"autonumber" (which is the primary key). I would like to search
by
familyname.
How can I change that?
 
Okay, if the combo is named:
product
and you set the On Load property of the form to:
=FindAsUTypeLoad([Form],"product")
then the product combo should not be in the list of fields when you drop
down cboFindAsUTypeField.

I guess it is possible that you have another control that has an attached
label that reads "product", and so you are seeing that one in the list of
fields. To test that idea
1.Choose product in cboFindAsUTypeField.
2. Click in the text box to ensure the value is updated.
3. Press Ctrl+G to open the Immediate window:
4. Enter:
? Forms![Form1].cboFindAsUTypeField
Access will respond with the name of the control we are planning to filter
on. It's a hidden column, so could be different from the name displayed in
the combo.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Amateur said:
Allen - confusion up 16.

I believe it's better to tell you everything I have and did:

"product_Label" is the label attached to the text box.
(property,other,name)
"Producto" is the name of the label (property, format, caption)
"product" is the name of the text box (property,other,name)
"product" is the name of the text box control source
(property,data,control
source)

I've tried all of them in your line =FindAsUTypeLoad([Form],"......",etc)
Now you have all but none of them are working. What am I doing wrong?
Peter
Allen Browne said:
Peter, what exactly is in the Name property of the combo?

Is it:
product Label
i.e. with a space?

Or does it really have the underscore?

Or is product_Label the name of the label attached to the combo?

Amateur said:
Dear Allen

I entered the following line into the Form property event, it looks
like
this:
=FindAsUTypeLoad ( [Form], "product_Label")
No chance, I always see the "product" in the combo box.
Do I have to change something else what I maybe forgot?
Thanks
Peter

:

In form design view, right-click the control you want to suppress, and
choose Properties. On the Other tab of the Properties box, is the Name
property. It is this name you need to use, not the Control Source
(which
is
what you see in the control on the form.)

Often the Name and Control Source are the same, and that's no problem.
But
if they are different, you must use the Name, not the Control Source
to
supress filtering of the control.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

I'm to nervous now to stop - so I tried it again.
*I entered the following into the On Load property: =FindAsUTypeLoad
(
[Form], "product") - product should be the contol name (if control
name
and
control source is the same) - It did not work, "product" is still in
the
combo box.
* than I tried it with this:=FindAsUTypeLoad ( [Form], "Product") -
Product
should be the field name (if field name and Caption is the same) -
it
didn't
work neither.
I believe if control source and control name are not the same than
please
tell me where to find the control name. If they are both the same
than
I
don't know what I could have done wrong.
Thanks
Peter
:

Re (b), you could put a button alongside the text box, and add the
code:
Me.txtFindAsUTypeValue = Null
Call FindAsUTypeChange(Me)

Re (a) you wanted to remove all the controls so they are not listed
in
the
combo? Did you use the name of the controls (not the name of the
fields)?
Post exactly what you used.

Hi Allen
thanks for your answer, it's working like you said in principle.
I do have two question concerning your "FindAsUType":
a) I wrote in the property (event) on my form as you instructed
for
filtering out each control name. I used quotes arround each
contol
and
commas
to seperate them. - Result: Not filtered, all controll names are
still
shown.
Any idea to help me?
b) if I write the search name in the text box it stays there
until I
delete
it with the mouse. Is there any possibility to clear the Textbox
with a
clear
button?
Thanks
Klaus


:

If the autonumber is tied to the family name, you could use a
combo
to
find
the record you want. There is a combo wizard to do that, or
follow
the
approach in this article:
Using a Combo Box to Find Records
at:
http://allenbrowne.com/ser-03.html

If you want to be able to search on any field, filtering the
form
with
each
keystroke, you could download the example in this article and
import
it
into
your database:
Find as you type - Filter forms with each keystroke
at:
http://allenbrowne.com/AppFindAsUType.html

Dear Sirs
I would like to create a "Search record" button in my form.
I did it with the wizzard but the it is only searching in
terms
of
"autonumber" (which is the primary key). I would like to
search
by
familyname.
How can I change that?
 
Dear Allen
I tried as you said and didn't work.
Than I tried your second choice and I wrote in VB:
Call FindAsUTypeLoad(Me, "product") - and YUPEEEEE, it worked.
Thank you very much for your help.
Peter

Allen Browne said:
Okay, if the combo is named:
product
and you set the On Load property of the form to:
=FindAsUTypeLoad([Form],"product")
then the product combo should not be in the list of fields when you drop
down cboFindAsUTypeField.

I guess it is possible that you have another control that has an attached
label that reads "product", and so you are seeing that one in the list of
fields. To test that idea
1.Choose product in cboFindAsUTypeField.
2. Click in the text box to ensure the value is updated.
3. Press Ctrl+G to open the Immediate window:
4. Enter:
? Forms![Form1].cboFindAsUTypeField
Access will respond with the name of the control we are planning to filter
on. It's a hidden column, so could be different from the name displayed in
the combo.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Amateur said:
Allen - confusion up 16.

I believe it's better to tell you everything I have and did:

"product_Label" is the label attached to the text box.
(property,other,name)
"Producto" is the name of the label (property, format, caption)
"product" is the name of the text box (property,other,name)
"product" is the name of the text box control source
(property,data,control
source)

I've tried all of them in your line =FindAsUTypeLoad([Form],"......",etc)
Now you have all but none of them are working. What am I doing wrong?
Peter
Allen Browne said:
Peter, what exactly is in the Name property of the combo?

Is it:
product Label
i.e. with a space?

Or does it really have the underscore?

Or is product_Label the name of the label attached to the combo?

Dear Allen

I entered the following line into the Form property event, it looks
like
this:
=FindAsUTypeLoad ( [Form], "product_Label")
No chance, I always see the "product" in the combo box.
Do I have to change something else what I maybe forgot?
Thanks
Peter

:

In form design view, right-click the control you want to suppress, and
choose Properties. On the Other tab of the Properties box, is the Name
property. It is this name you need to use, not the Control Source
(which
is
what you see in the control on the form.)

Often the Name and Control Source are the same, and that's no problem.
But
if they are different, you must use the Name, not the Control Source
to
supress filtering of the control.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

I'm to nervous now to stop - so I tried it again.
*I entered the following into the On Load property: =FindAsUTypeLoad
(
[Form], "product") - product should be the contol name (if control
name
and
control source is the same) - It did not work, "product" is still in
the
combo box.
* than I tried it with this:=FindAsUTypeLoad ( [Form], "Product") -
Product
should be the field name (if field name and Caption is the same) -
it
didn't
work neither.
I believe if control source and control name are not the same than
please
tell me where to find the control name. If they are both the same
than
I
don't know what I could have done wrong.
Thanks
Peter
:

Re (b), you could put a button alongside the text box, and add the
code:
Me.txtFindAsUTypeValue = Null
Call FindAsUTypeChange(Me)

Re (a) you wanted to remove all the controls so they are not listed
in
the
combo? Did you use the name of the controls (not the name of the
fields)?
Post exactly what you used.

Hi Allen
thanks for your answer, it's working like you said in principle.
I do have two question concerning your "FindAsUType":
a) I wrote in the property (event) on my form as you instructed
for
filtering out each control name. I used quotes arround each
contol
and
commas
to seperate them. - Result: Not filtered, all controll names are
still
shown.
Any idea to help me?
b) if I write the search name in the text box it stays there
until I
delete
it with the mouse. Is there any possibility to clear the Textbox
with a
clear
button?
Thanks
Klaus


:

If the autonumber is tied to the family name, you could use a
combo
to
find
the record you want. There is a combo wizard to do that, or
follow
the
approach in this article:
Using a Combo Box to Find Records
at:
http://allenbrowne.com/ser-03.html

If you want to be able to search on any field, filtering the
form
with
each
keystroke, you could download the example in this article and
import
it
into
your database:
Find as you type - Filter forms with each keystroke
at:
http://allenbrowne.com/AppFindAsUType.html

Dear Sirs
I would like to create a "Search record" button in my form.
I did it with the wizzard but the it is only searching in
terms
of
"autonumber" (which is the primary key). I would like to
search
by
familyname.
How can I change that?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top