Nathaniel_613
Nathaniel_613

Reputation: 179

Form button that runs query that is bound to value in given record field

I have a 2007 Access form, in "continuous format". I added a button to the “detail" section. Tje purpose of this button is to run a query. I cant figure out how to make this button’s query become bound to a field value in the given record. Instead, it runs the query for all records in the table. Please advise how I can have the query only run based on the value of a specific field for the given record . Is it possible to accomplish this with out VBA?

Thank you very much in advance

Upvotes: 0

Views: 2827

Answers (1)

Fionnuala
Fionnuala

Reputation: 91376

Alter your query to refer to your form. Like so:

SELECT ID, Stuff FROM MyTable WHERE ID = Forms!MyForm!ID

Where ID is whatever field you choose to match. It will always refer to the line where the button is clicked, because that is the current record.

Upvotes: 1

Related Questions