473,396 Members | 2,082 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Linking a Text Box in a Form to the Criteria in a Query using "Like"

5
I have tried just about everything that I can think of, so now I turn to you all for help!

I have created a form (titled "OAG") with an unbound textbox titled "DOW". I also have a Query that I have set up to return results using the abbreviations for the day of the week, and periods when that day is not present. For example, if the pattern is Monday, Wednesday, Friday, the query shows it as "Mon.Wed.Fri.." (periods replace Tues, Thurs, Sat, and Sun). There are several thousands of records with this type of pattern.

When I type in "Like *Mon*" in the criteria for the query, it returns only those results that contain Monday... which is perfect. However, I would like to link the form to the query so that when I type in "Mon" in the text box on the form, and then run the query, only the records that contain "Mon" show. I have created a report and a command button so that ultimately when I work out all the kinks, I can click the command button on the form and a report will pop up showing only the records that contain those days that I typed into the box.

I have tried to type "[Forms]![OAG]![DOW]" into the criteria of the query to link the two, but no data returns when I test it. I have also tried just about every combination of "Like" "Mon" "*" and "[Forms]![OAG]![DOW]" that I can possibly think of.

Any suggestions? I have the sql code available if needed... any help is GREATLY APPRECIATED!!
Aug 15 '07 #1
4 3707
JConsulting
603 Expert 512MB
I have tried just about everything that I can think of, so now I turn to you all for help!

I have created a form (titled "OAG") with an unbound textbox titled "DOW". I also have a Query that I have set up to return results using the abbreviations for the day of the week, and periods when that day is not present. For example, if the pattern is Monday, Wednesday, Friday, the query shows it as "Mon.Wed.Fri.." (periods replace Tues, Thurs, Sat, and Sun). There are several thousands of records with this type of pattern.

When I type in "Like *Mon*" in the criteria for the query, it returns only those results that contain Monday... which is perfect. However, I would like to link the form to the query so that when I type in "Mon" in the text box on the form, and then run the query, only the records that contain "Mon" show. I have created a report and a command button so that ultimately when I work out all the kinks, I can click the command button on the form and a report will pop up showing only the records that contain those days that I typed into the box.

I have tried to type "[Forms]![OAG]![DOW]" into the criteria of the query to link the two, but no data returns when I test it. I have also tried just about every combination of "Like" "Mon" "*" and "[Forms]![OAG]![DOW]" that I can possibly think of.

Any suggestions? I have the sql code available if needed... any help is GREATLY APPRECIATED!!
Have you tried

Like "*" & [Forms]![OAG]![DOW] & "*"
Aug 16 '07 #2
puppydogbuddy
1,923 Expert 1GB
I have tried just about everything that I can think of, so now I turn to you all for help!

I have created a form (titled "OAG") with an unbound textbox titled "DOW". I also have a Query that I have set up to return results using the abbreviations for the day of the week, and periods when that day is not present. For example, if the pattern is Monday, Wednesday, Friday, the query shows it as "Mon.Wed.Fri.." (periods replace Tues, Thurs, Sat, and Sun). There are several thousands of records with this type of pattern.

When I type in "Like *Mon*" in the criteria for the query, it returns only those results that contain Monday... which is perfect. However, I would like to link the form to the query so that when I type in "Mon" in the text box on the form, and then run the query, only the records that contain "Mon" show. I have created a report and a command button so that ultimately when I work out all the kinks, I can click the command button on the form and a report will pop up showing only the records that contain those days that I typed into the box.

I have tried to type "[Forms]![OAG]![DOW]" into the criteria of the query to link the two, but no data returns when I test it. I have also tried just about every combination of "Like" "Mon" "*" and "[Forms]![OAG]![DOW]" that I can possibly think of.

Any suggestions? I have the sql code available if needed... any help is GREATLY APPRECIATED!!
Try this syntax in the criteria row of your query:

Like "*" & Forms![OAG]![DOW] & "*"
Aug 16 '07 #3
JConsulting
603 Expert 512MB
Try this syntax in the criteria row of your query:

Like "*" & Forms![OAG]![DOW] & "*"
Great minds eh PDB!!
Good to see you out and around. Hope all is well.
J
Aug 17 '07 #4
puppydogbuddy
1,923 Expert 1GB
Great minds eh PDB!!
Good to see you out and around. Hope all is well.
J

Jeff!!

Have been so busy lately that I did not even realize that anybody had responded to this post until now. Hope you are happy in your new job and wishing you the best.....I am sure you are showing them the way it's done....

pDog
Aug 17 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Bill Brinkworth | last post by:
I want the user to type in part of a word, and I want to return all words from an Access word table that contains specified letters. If they were to type "fe??", it should return all words in the...
2
by: Adam Short | last post by:
I've never needed it before but now I do! Does anyone know if you are able to perform a NOT Like search using Classic ASP ADO? i.e. myData.Filter = "Ref NOT LIKE '*1234*'" by the way this...
10
by: joshsackett | last post by:
I am starting an encryption project for my database and I'm performing some tests on decryption speed. A lot of my application queries use a LIKE parameter in the WHERE clause. To keep from...
2
by: Big John | last post by:
in Access 2003 I am trying to get sql query to run using a field as input, but I want to input into the field a value that uses the "like" operator to find any value that starts with the value...
1
by: S. van Beek | last post by:
Dear reader, How can I filter a numeric field with Like as criteria in a query. To filter a numeric field with <10 as criteria this will com back with the result of those records for which...
11
by: Bruce Lawrence | last post by:
Ok, I'm baffled... I'm making a query in access 97 between 2 tables. There is a field in both tables called "DWGNO". OPENORD has a record with a DWGNO of "00000012345" DIEDATA has a record...
5
by: brino | last post by:
hi all ! i want to use the "like" function in a query but i want the user to enter the search variable. i have tried "like" but this doesnt return any results for some reason. any ideas ??? ...
9
by: Drum2001 | last post by:
Hello All! I am using the following code during an On Click event for a button. It works properly to create a query for a report: Private Sub Command14_Click() If IsNull(Me.Text30) Then ' No...
7
by: MLH | last post by:
If I drop Like "*ABC*" in a QBE grid criteria cell, the records returned include mixed case. Can I force the uppercase limitation in a QBE grid?
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.