Checking a field value in another form

S

Steven Waugh

I am trying to check the value in a separate form, but I am not having much luck.

I used the following, but it keeps coming back with a message stating that it cannot find the form with that name?

part of code: "IsNull(Forms![frm Flows & Loads].txtWICSizeBand.value)"

The form name and field name are typed correctly. Any ideas?
 
S

SteveS

Steven said:
I am trying to check the value in a separate form, but I am not having much luck.

I used the following, but it keeps coming back with a message stating that it cannot find the form with that name?

part of code: "IsNull(Forms![frm Flows & Loads].txtWICSizeBand.value)"

The form name and field name are typed correctly. Any ideas?

Is the form [frm Flows & Loads] Open?

Is the line part of a SQL statement or the criteria for a query?


Note that .value is the default property, so you can write the statement as:

IsNull(Forms![frm Flows & Loads].txtWICSizeBand)
 
S

Steven Waugh

There is one main form that contains a number of subforms

Say for example subform1 "General" is the form I am coding and subform2 "frm Flows & Loads" is the form I am checking the value for

The code is there so that a field is either visible/invisible, depending on the value in subform2

----- SteveS wrote: ----

Steven Waugh wrote
I am trying to check the value in a separate form, but I am not having much luck
I used the following, but it keeps coming back with a message stating that it cannot find the form with that name
part of code: "IsNull(Forms![frm Flows & Loads].txtWICSizeBand.value)
The form name and field name are typed correctly. Any ideas

Is the form [frm Flows & Loads] Open

Is the line part of a SQL statement or the criteria for a query


Note that .value is the default property, so you can write the statement as

IsNull(Forms![frm Flows & Loads].txtWICSizeBand
 
J

Jeff Boyce

Steven

You may have diagnosed your issue -- the form holding the value you wish to
check isn't a form, it's a subform. The expression for referring to a value
in a subform needs to have the "full path" explicitly stated.

Take a look in Access HELP for "expressions" and "subform" -- it goes
something like (actual syntax may vary):

Forms![MyMainForm]![MySubformControlName].Form![ControlNameInSubform]
 
S

SteveS

Jeff said:
Steven

You may have diagnosed your issue -- the form holding the value you wish to
check isn't a form, it's a subform. The expression for referring to a value
in a subform needs to have the "full path" explicitly stated.

Take a look in Access HELP for "expressions" and "subform" -- it goes
something like (actual syntax may vary):

Forms![MyMainForm]![MySubformControlName].Form![ControlNameInSubform]


Also check out

"Refer to Form and Subform properties and controls" at:

http://mvps.org/access/forms/frm0031.htm
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top