Need some help with code and SQL

MattCollins

Registered User.
Local time
Today, 08:45
Joined
Aug 12, 2005
Messages
49
Ok i'm very new at SQL and i have a bit of a problem.

Ok for instance in my query i have:

[Forms]![INPUT PAGE MGT]![PropertyCode]

in my criteria box. This works fantastically however is there a way to change what is written in the criteria box using VB code in a form?
 
sSQL = "SELECT * FROM YoourTable WHERE PropertyCode=" & Forms![INPUT PAGE MGT]!PropertyCode

Note - stop use space in names, it will cause you all kinds of problems.
 
llkhoutx thank you :) i know it already has caused problems lol i've stopped using spaces now though lol

Still a little confused though.

I have a query on which a report is based, however you can access the report from two different places. The Criteria above will only work from one location and so i was hoping to write some code in the second location so that this criteria is changed.
 
Last edited:
Check "OpenReport Action" in the Access Help menu, I thing that you can open the report with the report filter as an argument.
 

Users who are viewing this thread

Back
Top Bottom