Missing something

T

tdemartino

I found this code from 10/2002 to help me with creating a search in
Access. I have it 1/2 working, when I open the first form (form1), it
first open the query to ask what I'm searching for, then it opens the
Paraform for me to input again what I'm searching for.

Did I miss something in the code instruction?

Thanks,

TraceyDee


I would like to have a search option in my form to search *, in a field
or group of fields.
---------------------------------------------------------------------------------------------------------------------------------------------
From: Fredg - view profile
Date: Wed, Oct 16 2002 8:31 am
Email: "Fredg" <[email protected]>
Groups: comp.databases.ms-access
Not yet ratedRating:
show options
Reply | Reply to Author | Forward | Print | Individual Message | Show
original | Report Abuse | Find messages by this author


Chris,
Make a new Query, based upon whatever table(s) you require to get the
data
you need.
On the Field to be searched's Criteria line, write:
Like "*" & forms!ParamForm!SearchFor & "*"

Make a new Form, using the query as Record Source.
Code the Form's Open event:
DoCmd.OpenForm "ParamForm", , , , , acDialog


Code the Form's Close event:
DoCmd.Close acForm, "ParamForm"


Next, make a new Form.
Add a text control for each different field of data you wish to search
for.
(I'm going to use just one here.)
Name it SearchFor.
Add a Command Button.
Code the button's Click event:
Me.Visible = False
Name this form ParamForm.


When you are ready to search your database, open the first form.
It will open the ParamForm.
Enter the search word or phrase.
Click the Command Button.
The form will show all records that contain that word/phrase anywhere
in the
appropriate field.
When you close the form, the ParamForm will also close.
 
D

Douglas J. Steele

It's not clear to me whether ParaForm is already open when you open form1.
It must be.
 
T

tdemartino

Thank you,

No, the Paraform is closed. I must be either missing a step or setting
this up incorrectly.

However, I found another way to do this using Allen Browne's download
file for form searching http://allenbrowne.com/ser-62.html

I wonder, is there a way to tell my search criteria to accept the inch
mark ("), when searching to get results for lets say 60" tubing.

I have a field that has measurements in it and when I type the inch
mark in the search field on the form I get this error on a Visual Basic
pop up:
run time error 3075
Syntex error in query expression '([DescriptionMatName])
Like "*60"*")'

Thanks so much for any help.
 
D

Douglas J. Steele

The problem is that you're using " as the text delimiter and you've got " in
the text itself.

You either need to change your text delimiter to ' (in which case you'll run
into problems if you have ', signifying feet, in your text), or else you
have to use the Replace function to double up the character in the text:

Replace(Forms!FormName!ControlName, """", """""")

or

Replace(Forms!FormName!ControlName, Chr$(34), Chr$(34) & Chr$(34))

I talk about this in my May, 2004 "Access Answers" column in Pinnacle
Publication's "Smart Access". You can download the column (and sample
database) for free at http://www.accessmvp.com/DJSteele/SmartAccess.html


--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Thank you,

No, the Paraform is closed. I must be either missing a step or setting
this up incorrectly.

However, I found another way to do this using Allen Browne's download
file for form searching http://allenbrowne.com/ser-62.html

I wonder, is there a way to tell my search criteria to accept the inch
mark ("), when searching to get results for lets say 60" tubing.

I have a field that has measurements in it and when I type the inch
mark in the search field on the form I get this error on a Visual Basic
pop up:
run time error 3075
Syntex error in query expression '([DescriptionMatName])
Like "*60"*")'

Thanks so much for any help.
It's not clear to me whether ParaForm is already open when you open
form1.
It must be.
 
T

tdemartino

Where would I put this replace function? (I did download your sample
and it works GREAT!!!!), but I actually would like to use the other one
I found because it also has a date criteria. So I would like to
combine both functions in 1.

The problem is that you're using " as the text delimiter and you've got " in
the text itself.

You either need to change your text delimiter to ' (in which case you'll run
into problems if you have ', signifying feet, in your text), or else you
have to use the Replace function to double up the character in the text:

Replace(Forms!FormName!ControlName, """", """""")

or

Replace(Forms!FormName!ControlName, Chr$(34), Chr$(34) & Chr$(34))

I talk about this in my May, 2004 "Access Answers" column in Pinnacle
Publication's "Smart Access". You can download the column (and sample
database) for free at http://www.accessmvp.com/DJSteele/SmartAccess.html


--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Thank you,

No, the Paraform is closed. I must be either missing a step or setting
this up incorrectly.

However, I found another way to do this using Allen Browne's download
file for form searching http://allenbrowne.com/ser-62.html

I wonder, is there a way to tell my search criteria to accept the inch
mark ("), when searching to get results for lets say 60" tubing.

I have a field that has measurements in it and when I type the inch
mark in the search field on the form I get this error on a Visual Basic
pop up:
run time error 3075
Syntex error in query expression '([DescriptionMatName])
Like "*60"*")'

Thanks so much for any help.
It's not clear to me whether ParaForm is already open when you open
form1.
It must be.

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


I found this code from 10/2002 to help me with creating a search in
Access. I have it 1/2 working, when I open the first form (form1), it
first open the query to ask what I'm searching for, then it opens the
Paraform for me to input again what I'm searching for.

Did I miss something in the code instruction?

Thanks,

TraceyDee


I would like to have a search option in my form to search *, in a field
or group of fields.
---------------------------------------------------------------------------------------------------------------------------------------------
From: Fredg - view profile
Date: Wed, Oct 16 2002 8:31 am
Email: "Fredg" <[email protected]>
Groups: comp.databases.ms-access
Not yet ratedRating:
show options
Reply | Reply to Author | Forward | Print | Individual Message | Show
original | Report Abuse | Find messages by this author


Chris,
Make a new Query, based upon whatever table(s) you require to get the
data
you need.
On the Field to be searched's Criteria line, write:
Like "*" & forms!ParamForm!SearchFor & "*"

Make a new Form, using the query as Record Source.
Code the Form's Open event:
DoCmd.OpenForm "ParamForm", , , , , acDialog


Code the Form's Close event:
DoCmd.Close acForm, "ParamForm"


Next, make a new Form.
Add a text control for each different field of data you wish to search
for.
(I'm going to use just one here.)
Name it SearchFor.
Add a Command Button.
Code the button's Click event:
Me.Visible = False
Name this form ParamForm.


When you are ready to search your database, open the first form.
It will open the ParamForm.
Enter the search word or phrase.
Click the Command Button.
The form will show all records that contain that word/phrase anywhere
in the
appropriate field.
When you close the form, the ParamForm will also close.
 
D

Douglas J. Steele

Sorry, I haven't downloaded Allen's solution, so I'm not sure. It shouldn't
be difficult to add additional criteria to a query though.

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Where would I put this replace function? (I did download your sample
and it works GREAT!!!!), but I actually would like to use the other one
I found because it also has a date criteria. So I would like to
combine both functions in 1.

The problem is that you're using " as the text delimiter and you've got "
in
the text itself.

You either need to change your text delimiter to ' (in which case you'll
run
into problems if you have ', signifying feet, in your text), or else you
have to use the Replace function to double up the character in the text:

Replace(Forms!FormName!ControlName, """", """""")

or

Replace(Forms!FormName!ControlName, Chr$(34), Chr$(34) & Chr$(34))

I talk about this in my May, 2004 "Access Answers" column in Pinnacle
Publication's "Smart Access". You can download the column (and sample
database) for free at http://www.accessmvp.com/DJSteele/SmartAccess.html


--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Thank you,

No, the Paraform is closed. I must be either missing a step or setting
this up incorrectly.

However, I found another way to do this using Allen Browne's download
file for form searching http://allenbrowne.com/ser-62.html

I wonder, is there a way to tell my search criteria to accept the inch
mark ("), when searching to get results for lets say 60" tubing.

I have a field that has measurements in it and when I type the inch
mark in the search field on the form I get this error on a Visual Basic
pop up:
run time error 3075
Syntex error in query expression '([DescriptionMatName])
Like "*60"*")'

Thanks so much for any help.

Douglas J. Steele wrote:
It's not clear to me whether ParaForm is already open when you open
form1.
It must be.

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


I found this code from 10/2002 to help me with creating a search in
Access. I have it 1/2 working, when I open the first form (form1),
it
first open the query to ask what I'm searching for, then it opens
the
Paraform for me to input again what I'm searching for.

Did I miss something in the code instruction?

Thanks,

TraceyDee


I would like to have a search option in my form to search *, in a
field
or group of fields.
---------------------------------------------------------------------------------------------------------------------------------------------
From: Fredg - view profile
Date: Wed, Oct 16 2002 8:31 am
Email: "Fredg" <[email protected]>
Groups: comp.databases.ms-access
Not yet ratedRating:
show options
Reply | Reply to Author | Forward | Print | Individual Message |
Show
original | Report Abuse | Find messages by this author


Chris,
Make a new Query, based upon whatever table(s) you require to get
the
data
you need.
On the Field to be searched's Criteria line, write:
Like "*" & forms!ParamForm!SearchFor & "*"

Make a new Form, using the query as Record Source.
Code the Form's Open event:
DoCmd.OpenForm "ParamForm", , , , , acDialog


Code the Form's Close event:
DoCmd.Close acForm, "ParamForm"


Next, make a new Form.
Add a text control for each different field of data you wish to
search
for.
(I'm going to use just one here.)
Name it SearchFor.
Add a Command Button.
Code the button's Click event:
Me.Visible = False
Name this form ParamForm.


When you are ready to search your database, open the first form.
It will open the ParamForm.
Enter the search word or phrase.
Click the Command Button.
The form will show all records that contain that word/phrase
anywhere
in the
appropriate field.
When you close the form, the ParamForm will also close.
 
T

tdemartino

Hi Again,

I decided to use your form (it better served my purposes), from your
May, 2004 Access Answers. I tweaked it to my needs as much as I could
from what I understood, and it working really great....except, I'd like
to know about 2 thing additional things:

I'm only use the "#5" search button (this is one that helps me w/the
measurements if someone types in 60"), but I've noticed that if I
search for 2 words that are not back to back (Yellow Tubing) nothing
comes up, unless the description field has these 2 words in that order
If the description field I'm pulling from says "Yellow braided Tubing"
and I ask for Yellow Tubing I get zero results. Is there any way to
adjust the code?

Also, Can I also put a date field in your example, to have people also
search (if they choose) by a date the entry was made?

Any - more - help would be greatly appreciated.

TraceyDee
The problem is that you're using " as the text delimiter and you've got " in
the text itself.

You either need to change your text delimiter to ' (in which case you'll run
into problems if you have ', signifying feet, in your text), or else you
have to use the Replace function to double up the character in the text:

Replace(Forms!FormName!ControlName, """", """""")

or

Replace(Forms!FormName!ControlName, Chr$(34), Chr$(34) & Chr$(34))

I talk about this in my May, 2004 "Access Answers" column in Pinnacle
Publication's "Smart Access". You can download the column (and sample
database) for free at http://www.accessmvp.com/DJSteele/SmartAccess.html


--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Thank you,

No, the Paraform is closed. I must be either missing a step or setting
this up incorrectly.

However, I found another way to do this using Allen Browne's download
file for form searching http://allenbrowne.com/ser-62.html

I wonder, is there a way to tell my search criteria to accept the inch
mark ("), when searching to get results for lets say 60" tubing.

I have a field that has measurements in it and when I type the inch
mark in the search field on the form I get this error on a Visual Basic
pop up:
run time error 3075
Syntex error in query expression '([DescriptionMatName])
Like "*60"*")'

Thanks so much for any help.
It's not clear to me whether ParaForm is already open when you open
form1.
It must be.

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


I found this code from 10/2002 to help me with creating a search in
Access. I have it 1/2 working, when I open the first form (form1), it
first open the query to ask what I'm searching for, then it opens the
Paraform for me to input again what I'm searching for.

Did I miss something in the code instruction?

Thanks,

TraceyDee


I would like to have a search option in my form to search *, in a field
or group of fields.
---------------------------------------------------------------------------------------------------------------------------------------------
From: Fredg - view profile
Date: Wed, Oct 16 2002 8:31 am
Email: "Fredg" <[email protected]>
Groups: comp.databases.ms-access
Not yet ratedRating:
show options
Reply | Reply to Author | Forward | Print | Individual Message | Show
original | Report Abuse | Find messages by this author


Chris,
Make a new Query, based upon whatever table(s) you require to get the
data
you need.
On the Field to be searched's Criteria line, write:
Like "*" & forms!ParamForm!SearchFor & "*"

Make a new Form, using the query as Record Source.
Code the Form's Open event:
DoCmd.OpenForm "ParamForm", , , , , acDialog


Code the Form's Close event:
DoCmd.Close acForm, "ParamForm"


Next, make a new Form.
Add a text control for each different field of data you wish to search
for.
(I'm going to use just one here.)
Name it SearchFor.
Add a Command Button.
Code the button's Click event:
Me.Visible = False
Name this form ParamForm.


When you are ready to search your database, open the first form.
It will open the ParamForm.
Enter the search word or phrase.
Click the Command Button.
The form will show all records that contain that word/phrase anywhere
in the
appropriate field.
When you close the form, the ParamForm will also close.
 

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

Top