Checking a field value in another form

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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?
 
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)
 
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
 
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]
 
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
 
Back
Top