Microsoft Access Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 



Go Back   Dev Articles Community ForumsDatabasesMicrosoft Access Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old December 9th, 2004, 03:33 PM
asenguah asenguah is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2004
Posts: 3 asenguah User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 m 22 sec
Reputation Power: 0
Unhappy entering query criteria via a form

Can anyone help please
[a]
I need a way of editing queries that is easy for a novice user (via a form )instead of directly editing the query itself.
Scenario
I have a table of five fields, one holds the age field (number format) with five records
create a simple query with no criteria from the table
Now i want a form which the user can use to query the table to show the field but the user should be able to enter
in any number in the age field to query the table to bring up all the resulting records that have the entered number value
from the age field

Basicaly there would be an enter query form with a button which should then open up the resulting query depending on the
criteria entered. Thus making it easy for the user to easily edit the query
[b]
another similar problem is a form to query a database to check for records that fall between two dates eg. from x to x
I want the user to enter the crietria via a form instead of editing the query which is not flexible for the scenrio i want

Reply With Quote
  #2  
Old December 10th, 2004, 03:43 PM
lwells lwells is offline
Contributing User
Dev Articles Novice (500 - 999 posts)
 
Join Date: Sep 2004
Posts: 632 lwells User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 21 h 59 m 38 sec
Reputation Power: 10
Hi asenguah

[a]
Place a text box on your form for the user to enter the age in. Then in your query design in the criteria row below the age field place this syntax:

Forms![FormName]![TextBoxName]

Use your form name and the text box name that you use on your form. This will open the query filtered by what the user typed in the textbox.

[b]
Place two text boxes on your form. Give one the name of StartDate and the other the name of EndDate. Then in your query design view in the criteria under the date field place this syntax:

Between [Forms]![FormName]!BeginningDate] And [Forms]![FormName]![EndingDate]

Just use your form name.

lwells

Reply With Quote
  #3  
Old December 15th, 2004, 07:17 AM
asenguah asenguah is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2004
Posts: 3 asenguah User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 m 22 sec
Reputation Power: 0
Thank you Iwells



Quote:
Originally Posted by lwells
Hi asenguah

[a]
Place a text box on your form for the user to enter the age in. Then in your query design in the criteria row below the age field place this syntax:

Forms![FormName]![TextBoxName]

Use your form name and the text box name that you use on your form. This will open the query filtered by what the user typed in the textbox.

[b]
Place two text boxes on your form. Give one the name of StartDate and the other the name of EndDate. Then in your query design view in the criteria under the date field place this syntax:

Between [Forms]![FormName]!BeginningDate] And [Forms]![FormName]![EndingDate]

Just use your form name.

lwells

Reply With Quote
  #4  
Old March 19th, 2009, 12:13 PM
Benji Benji is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2009
Posts: 1 Benji User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 m 23 sec
Reputation Power: 0
A follow up:

Iwells,

I did this, several times in fact, and get it to work. But when I close my database and reopen it, it doesn't work. I don't get why it forgets what to do, lol. I'm running Access 2007.
Thanks.

-Ben

Quote:
Originally Posted by lwells
Hi asenguah

[a]
Place a text box on your form for the user to enter the age in. Then in your query design in the criteria row below the age field place this syntax:

Forms![FormName]![TextBoxName]

Use your form name and the text box name that you use on your form. This will open the query filtered by what the user typed in the textbox.

[b]
Place two text boxes on your form. Give one the name of StartDate and the other the name of EndDate. Then in your query design view in the criteria under the date field place this syntax:

Between [Forms]![FormName]!BeginningDate] And [Forms]![FormName]![EndingDate]

Just use your form name.

lwells

Reply With Quote
  #5  
Old March 19th, 2009, 04:23 PM
AlanSidman's Avatar
AlanSidman AlanSidman is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Nov 2008
Location: Lake County, IL
Posts: 240 AlanSidman User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 15 h 49 m 19 sec
Reputation Power: 6
Look at this tutorial. It may help you to get there

http://www.datapigtechnologies.com/flashfiles/searchform.html

Alan
Comments on this post
keldwabbit agrees!
__________________
Alan Sidman
__________
If I helped you, I'd like to know. Click on the icon next to the thread number and tell me.

Reply With Quote
  #6  
Old October 2nd, 2009, 03:51 PM
RealNeal RealNeal is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2009
Posts: 7 RealNeal User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 9 m 50 sec
Reputation Power: 0
Syntax Issue?

When I try entering "Forms![FormName]![TextBoxName] " into the criteria in design (or for that matter SQL view) in Access 2003, it changes my syntax to:

[Forms]![FormName]![TextBoxName]

And then when I try to run the query I get a crieria popup with the text:

'Forms!FormName!TextBoxName'

which needless to say isn't what I want. What I am trying to do is to use a combo box from a form.

Can anyone advise what I am doing incorrectly?

Reply With Quote
  #7  
Old February 5th, 2011, 10:57 PM
keldwabbit keldwabbit is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Feb 2011
Posts: 1 keldwabbit User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 20 m 26 sec
Reputation Power: 0
Smile

Thank you!! This tutorial is a great way of constructing a form query!


Reply With Quote
  #8  
Old February 21st, 2011, 07:41 PM
June7's Avatar
June7 June7 is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2010
Location: The Great Land
Posts: 256 June7 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 Days 9 h 29 m 29 sec
Reputation Power: 4
RealNeal,
In place of TextBoxName, put the name of whatever field/control on your form you want to use as criteria. TextBoxName is a generic reference just for the example.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsDatabasesMicrosoft Access Development > entering query criteria via a form


Developer Shed Advertisers and Affiliates


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.

© 2003-2014 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap