|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
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. |
|
#2
|
|||
|
|||
|
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 |
|
#3
|
|||
|
|||
|
Hi mezza, that really helpful. I shall endevour and ge this workin of it is the last thing I do!
Many Thanks Charlottec Quote:
|
![]() |
| Viewing: Dev Articles Community Forums > Databases > Microsoft Access Development > Forms and Queries |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|