Table Were condition

Infinite

More left to learn.
Local time
Yesterday, 17:25
Joined
Mar 16, 2015
Messages
402
I am wondering, is it possible to have a were condition for a button to a table? I want to click the button, close the form I have, and open up my sales table, and have it have a were condition to be like what I have for my form
Code:
="[EventID]=" & [lstShows]
I have that for the form, and it works, I am just not sure if I can use that for a Table.

FYI: that "code" us being used in a openform macro. If there isnt a way to use a macro, how about VBA code?
 
Last edited:
...I have that for the form, and it works, I am just not sure if I can use that for a form.
What??
You write you've it on a form and it works, and then you've doubt, that is strange!
 
What??
You write you've it on a form and it works, and then you've doubt, that is strange!

Sorry! It was supposed to say Table, not form. Fixed it.
 
Well, technically the answer is "NO" - but that doesn't mean you can't do something here that is close to what you want.

Your block on the side of your posts claims you are still early in the learning stage of Access. Good luck with that, because it can take you far. However, remember to be methodical, because sometimes "taking you far" means far over the edge of sanity.

OK, you rarely want to use a direct table anywhere because recordsets from a table are slightly less flexible than recordsets from a query - and yet both behave nicely on forms and reports.

So let's say you have a continuous form that includes data from your query and you click your button. To do what you wanted to do, take the basic recordsource query that returns the whole query

Code:
SELECT x, y, z FROM qryW ;

and change it very slightly. In the button-click event code for the magic button you want to be active, add code that does two things:

1. Modify the recordsource query by replacing it with

Code:
SELECT x, y, z FROM qryW WHERE x = [mytextbox] ;

2. Do a form.Requery on the form that shows you that information.
 
Your block on the side of your posts claims you are still early in the learning stage of Access.

????

OK, you rarely want to use a direct table anywhere

Yes, I definitely know that, but I would still like the option to (from a form) go to the table, to see the records source, and change anything if needed.


So let's say you have a continuous form that includes data from your query and you click your button.

err, I dont have a query for the data I get from the tblShowSales.
 

Users who are viewing this thread

Back
Top Bottom