Reference a cell in a query using VB

dcfi6052

Registered User.
Local time
Yesterday, 16:47
Joined
Jan 25, 2012
Messages
34
Hey guys!

Just had a quick question. Are you able to reference the "criteria" cell in a query for a certain field using VBA code?

I know you can input [Forms]![Advanced Search]![YearBox] in the criteria cell of a query to reference a textbox of a form, but can you reference that same criteria cell in VBA code? Like:

If I have a query that's made up with multiple fields, but have no "criteria" cells filled out (blank query), can I use VBA code to fill out that query with a single button click? info would be filled in with references to textboxes from a form

[Query]![AdvancedSearchQuery]![MovieLength]![CriteriaCell]=[Forms]![Advanced Search]![YearBox]
for example?

This may not make any sense to anyone :o since I have no idea what I'm taliking about when it comes to code. I'll try and answer any questions to help clarify.
 

Users who are viewing this thread

Back
Top Bottom