473,383 Members | 1,733 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

Problem with SQL statement on subform

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
1 1060
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Neil | last post by:
I have a strange situation. I have a stored procedure that is hanging upon execution, but only some machines and not others. The db is an Access 2000 MDB using ODBC linked tables and a SQL 7 back...
2
by: Neil | last post by:
I have a strange situation. I have a stored procedure that is hanging upon execution, but only some machines and not others. The db is an Access 2000 MDB using ODBC linked tables and a SQL 7 back...
1
by: jburris | last post by:
I am completely new to VBA. I am trying to update a yes/no box in a subform based on a value that I call from the main form into the subform. Below is the if /then statement i am using: If...
4
by: joanWilder | last post by:
Hello. I am using MS Access 97 at work and trying to do the following... I have a main form which has several combo boxes, 2 buttons (search and refresh) and an unbound subform on it. This form...
21
by: cmd | last post by:
I have code in the OnExit event of a control on a subform. The code works properly in this instance. If, however, I put the same code in the OnExit event of a control on a Tab Control of a main...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.