By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,964 Members | 1,290 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,964 IT Pros & Developers. It's quick & easy.

Problem with SQL statement on subform

P: n/a
This is the outline.

I'm using a form (frmMain) as a Menu screen. Also I have a subform
(frmSub) that shows aditional info for the menu option selected.
When I focus one option on the main form [e.g. Option1_GetFocus()],
frmSub appears automatically and also set the value of an unbound field
called Status. I want to restrict these records on frmSub to match the
Status field on the Main Form. So in the criteria window of one of the
fields I wrote:

Like "Forms!frmMain!Field"

But when I open the form again and focus the Option, no records appears
in frmSub. I changed the criteria again to:

Like "Me.frmMain!Field"

and gave me the same result.

When I change the criteria to

Like "3"

which is one of the values of the records, form runs perfect.

What's wrong with the syntax?

Help will be apreciated.
Juan

Nov 13 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
mu**************@gmail.com wrote:
Like "Forms!frmMain!Field"


Air Criteria:

Like Forms!frmMain!MyField

Note that Field is not a good name for a field. If another criterion
is added be sure to put parentheses around any criteria containing
'Like' so that Access doesn't think the 'Or' or 'And' is part of the
'Like' expression. Is MyField assured never to be a Null value?

James A. Fortune

Nov 13 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.