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 2nd, 2004, 07:43 AM
charlottec charlottec is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2004
Posts: 2 charlottec User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Unhappy Forms and Queries

What I would like to do is run a query from a form button OnClick. The query is the problem.

I am trying to access one record and the query should be finding the ID from the form and matching it with the same id in the table. As I can I use a form as a table to be used in the FROM clause or I have the below WHERE clause, it should ask for the form ID, which it does, but then asks for the table ID and another ID.

Does anybody ahve any ideas?

Many Thanks

The idea should look like

WHERE frm_farmDetails.farm-ID = tbl_farmDetails.farm-ID.

Reply With Quote
  #2  
Old December 2nd, 2004, 11:16 AM
mezza1 mezza1 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2004
Posts: 12 mezza1 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 m 28 sec
Reputation Power: 0
Smile

Hi,

I think i get the drift of what you are asking...

there are various way of 'filtering' the data on a form open etc..

One would be setting the datasource of the form to a query lets say 'Query1'

In Query 1 (the following sql code)

SELECT tbl_FarmDetails.*
FROM tbl_FarmDetails
WHERE (((tbl_FarmDetails.farm-ID)=[Forms]![TheNameofTheform]![TheNameOfTheFieldOnTheForm]));

This will return the matching record in your table. One thing if you can, is make sure your field and table names use standard characters For example your farm-ID, should really be 'FarmID' or 'Farm_ID'.

You can also apply a filter on a form, goto the properties sheet for the form and add the filter, make sure the 'allow filters' is set to 'Yes'

Hope this helps, there are many other ways, let me know.

Cheers

Mezza1

Reply With Quote
  #3  
Old December 14th, 2004, 09:16 AM
charlottec charlottec is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2004
Posts: 2 charlottec User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Hi mezza, that really helpful. I shall endevour and ge this workin of it is the last thing I do!

Many Thanks

Charlottec


Quote:
Originally Posted by mezza1
Hi,

I think i get the drift of what you are asking...

there are various way of 'filtering' the data on a form open etc..

One would be setting the datasource of the form to a query lets say 'Query1'

In Query 1 (the following sql code)

SELECT tbl_FarmDetails.*
FROM tbl_FarmDetails
WHERE (((tbl_FarmDetails.farm-ID)=[Forms]![TheNameofTheform]![TheNameOfTheFieldOnTheForm]));

This will return the matching record in your table. One thing if you can, is make sure your field and table names use standard characters For example your farm-ID, should really be 'FarmID' or 'Farm_ID'.

You can also apply a filter on a form, goto the properties sheet for the form and add the filter, make sure the 'allow filters' is set to 'Yes'

Hope this helps, there are many other ways, let me know.

Cheers

Mezza1

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsDatabasesMicrosoft Access Development > Forms and Queries


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 | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
Stay green...Green IT