WHERE in a Control Source property

rikklaney1

Registered User.
Local time
Today, 13:54
Joined
Nov 20, 2014
Messages
157
is it possible to use WHERE in the Control Source property of a button on a form?

Something like this

= [Station Status]![Done] WHERE [station Status]![ID] = "28"
 
A button does not have a Control Source?

What are you trying to do with that piece of code? You are probably looking to use that code after the button is clicked.
 
This is a simple yes/no field BTW. It's a simple toggle button, I am just wondering if it is possible to link link it to a yes/no field in a specific record.
 
Yes you can. You can set it to a field in the recordset for your form. OR you can link it to a field in another table/recordset via VBA in the toggle buttons events.

Or is this toggle button in the form header/footer? Do you want certain records to be updated when that toggle button is selected? If so the simple answer is to create an update query and run that query in the toggle buttton's On_CLick or After_Update event.
 
Last edited:
Good to know. Now I have another question in my quest to learn Access. I have a form where, when I click the button I want it to save the record but not advance to a new record. I'm sure I've done it before but I'm not finding how. Any ideas?
 
I just noticed that the Record selector bar on the left of the screen does exactly that but I'd prefer to make a button.
 
Oops. nevermind. Turns out simply refreshing the form on a button click does exactly this.
 

Users who are viewing this thread

Back
Top Bottom