set combobox properties for subform on another tab

S

SusanV

TIA all,

I'm just NOT getting the syntax here, maybe I'm just tired. I'm not even
sure how to explain it, so bear with me if this is a tad unclear - a long
running project has had a change request requiring a new status which, if
true, modifies what a user can enter for this particular record. OK let me
try to explain this:

I've got a main form, with a tab control. The tab control has, let's say
2 tabs with subforms (it has more but I'm only working with 2 of them). On
Tab1 is a subform with a checkbox. When a user checks the box I have a
confirmation dialog, if the user cancels the change, then the options in the
combobox come from a lookup table with values L4, L3, L2, and L1, and the
box is unlocked (which is the original setup prior to this new change
request, and currently the default for the subform on Tab 2). If they
confirm the change, then I need to set the value of a dropdown box on Tab2's
subform to "Mandated" and lock it. (I then have a crapload more code but
this is the piece I'm stuck on)

specifics:
Main form: frmPMOReportData (parent/childlink fields not related to
controls I'm modifying)
Tab1 Subform: subfrmRepInfo Control: chkMandated (default = false)
Tab2 Subform: subfrmPmPlan Control: cboLOM

In an hour of looking on the web and hit-or-miss let's-try-this, the closest
I've gotten was:
Me.Parent!subfrmpmplan.Form!cboLOM = "MANDATED" which produced run-time
error 2465 "can't find the field 'subfrmPmPlan' referred to in your
expression"

Please help before I lose my mind!

TIA!

SusanV
 
M

Marshall Barton

SusanV said:
I'm just NOT getting the syntax here, maybe I'm just tired. I'm not even
sure how to explain it, so bear with me if this is a tad unclear - a long
running project has had a change request requiring a new status which, if
true, modifies what a user can enter for this particular record. OK let me
try to explain this:

I've got a main form, with a tab control. The tab control has, let's say
2 tabs with subforms (it has more but I'm only working with 2 of them). On
Tab1 is a subform with a checkbox. When a user checks the box I have a
confirmation dialog, if the user cancels the change, then the options in the
combobox come from a lookup table with values L4, L3, L2, and L1, and the
box is unlocked (which is the original setup prior to this new change
request, and currently the default for the subform on Tab 2). If they
confirm the change, then I need to set the value of a dropdown box on Tab2's
subform to "Mandated" and lock it. (I then have a crapload more code but
this is the piece I'm stuck on)

specifics:
Main form: frmPMOReportData (parent/childlink fields not related to
controls I'm modifying)
Tab1 Subform: subfrmRepInfo Control: chkMandated (default = false)
Tab2 Subform: subfrmPmPlan Control: cboLOM

In an hour of looking on the web and hit-or-miss let's-try-this, the closest
I've gotten was:
Me.Parent!subfrmpmplan.Form!cboLOM = "MANDATED" which produced run-time
error 2465 "can't find the field 'subfrmPmPlan' referred to in your
expression"


That error indicates that the name of the subform
**control** is not subfrmRepInfo.

Although that would probably be the name Access created if
the control were added to the main form by dragging a form
object from the db window and dropping it on the main form,
that is not guaranteed. For example, if you use the tool
box, Access just uses a generic name that has no
relationsihp to the name of the form object that you specify
in the subform control's SourceObject property.

After you get the proper value assigned to the combo box,
you can lock it:

Me.Parent!subformcontrolname.Form!cboLOM = "MANDATED"
Me.Parent!subformcontrolname.Form!cboLOM.Locked = True
 
S

SusanV

Oh... My... Gawd.

When I renamed the control I must have typoed and dropped the u - it's
SUPPOSED to be subfrmPmPlan (as the form is named) but in reality it's
sbfrmPmPlan.

Works perfect now - DOH!

Thanks Marshall - can't help being blonde some days!!!!

<grin>

SusanV
 
M

Marshall Barton

Susan, Susan, blonde's got nothing to do with it. How do
you think I got to be so familiar with that error message?
And what little hair I have left was never blonde ;-)
 
S

SusanV

LOL Marsh! After yesterday I don't think I have a whole lot left either!

<note to self - buy hat>

Marshall Barton said:
Susan, Susan, blonde's got nothing to do with it. How do
you think I got to be so familiar with that error message?
And what little hair I have left was never blonde ;-)
--
Marsh
MVP [MS Access]

Oh... My... Gawd.

When I renamed the control I must have typoed and dropped the u - it's
SUPPOSED to be subfrmPmPlan (as the form is named) but in reality it's
sbfrmPmPlan.

Works perfect now - DOH!

Thanks Marshall - can't help being blonde some days!!!!

<grin>

SusanV

"Marshall Barton" wrote
 
S

SusanV

Hey Marsh -

One more bit of trouble - for records where that box is checked, I want to
lock the combobox - but I can't seem to find the proper event to use?
OnCurrent, OnActivate, OnLoad - none seem to set the cbo to "MAN" and Locked
if that chk is True.
I added a button and OnClick check the value of the chk and set the
properties and repaint etc and it works?




SusanV said:
LOL Marsh! After yesterday I don't think I have a whole lot left either!

<note to self - buy hat>

Marshall Barton said:
Susan, Susan, blonde's got nothing to do with it. How do
you think I got to be so familiar with that error message?
And what little hair I have left was never blonde ;-)
--
Marsh
MVP [MS Access]

Oh... My... Gawd.

When I renamed the control I must have typoed and dropped the u - it's
SUPPOSED to be subfrmPmPlan (as the form is named) but in reality it's
sbfrmPmPlan.

Works perfect now - DOH!

Thanks Marshall - can't help being blonde some days!!!!

<grin>

SusanV

SusanV wrote:
I'm just NOT getting the syntax here, maybe I'm just tired. I'm not
even
sure how to explain it, so bear with me if this is a tad unclear - a
long
running project has had a change request requiring a new status which,
if
true, modifies what a user can enter for this particular record. OK let
me
try to explain this:

I've got a main form, with a tab control. The tab control has,
let's
say
2 tabs with subforms (it has more but I'm only working with 2 of them).
On
Tab1 is a subform with a checkbox. When a user checks the box I have a
confirmation dialog, if the user cancels the change, then the options
in
the
combobox come from a lookup table with values L4, L3, L2, and L1, and
the
box is unlocked (which is the original setup prior to this new change
request, and currently the default for the subform on Tab 2). If they
confirm the change, then I need to set the value of a dropdown box on
Tab2's
subform to "Mandated" and lock it. (I then have a crapload more code
but
this is the piece I'm stuck on)

specifics:
Main form: frmPMOReportData (parent/childlink fields not related to
controls I'm modifying)
Tab1 Subform: subfrmRepInfo Control: chkMandated (default =
false)
Tab2 Subform: subfrmPmPlan Control: cboLOM

In an hour of looking on the web and hit-or-miss let's-try-this, the
closest
I've gotten was:
Me.Parent!subfrmpmplan.Form!cboLOM = "MANDATED" which produced
run-time
error 2465 "can't find the field 'subfrmPmPlan' referred to in your
expression"


That error indicates that the name of the subform
**control** is not subfrmRepInfo.

Although that would probably be the name Access created if
the control were added to the main form by dragging a form
object from the db window and dropping it on the main form,
that is not guaranteed. For example, if you use the tool
box, Access just uses a generic name that has no
relationsihp to the name of the form object that you specify
in the subform control's SourceObject property.

After you get the proper value assigned to the combo box,
you can lock it:

Me.Parent!subformcontrolname.Form!cboLOM = "MANDATED"
Me.Parent!subformcontrolname.Form!cboLOM.Locked = True
 
S

SusanV

Nevermind - set the properties via the main form's OnCurrent
;-)

SusanV said:
Hey Marsh -

One more bit of trouble - for records where that box is checked, I want to
lock the combobox - but I can't seem to find the proper event to use?
OnCurrent, OnActivate, OnLoad - none seem to set the cbo to "MAN" and
Locked if that chk is True.
I added a button and OnClick check the value of the chk and set the
properties and repaint etc and it works?




SusanV said:
LOL Marsh! After yesterday I don't think I have a whole lot left either!

<note to self - buy hat>

Marshall Barton said:
Susan, Susan, blonde's got nothing to do with it. How do
you think I got to be so familiar with that error message?
And what little hair I have left was never blonde ;-)
--
Marsh
MVP [MS Access]


SusanV wrote:

Oh... My... Gawd.

When I renamed the control I must have typoed and dropped the u - it's
SUPPOSED to be subfrmPmPlan (as the form is named) but in reality it's
sbfrmPmPlan.

Works perfect now - DOH!

Thanks Marshall - can't help being blonde some days!!!!

<grin>

SusanV

SusanV wrote:
I'm just NOT getting the syntax here, maybe I'm just tired. I'm
not
even
sure how to explain it, so bear with me if this is a tad unclear - a
long
running project has had a change request requiring a new status which,
if
true, modifies what a user can enter for this particular record. OK
let me
try to explain this:

I've got a main form, with a tab control. The tab control has,
let's
say
2 tabs with subforms (it has more but I'm only working with 2 of
them). On
Tab1 is a subform with a checkbox. When a user checks the box I have a
confirmation dialog, if the user cancels the change, then the options
in
the
combobox come from a lookup table with values L4, L3, L2, and L1, and
the
box is unlocked (which is the original setup prior to this new change
request, and currently the default for the subform on Tab 2). If they
confirm the change, then I need to set the value of a dropdown box on
Tab2's
subform to "Mandated" and lock it. (I then have a crapload more code
but
this is the piece I'm stuck on)

specifics:
Main form: frmPMOReportData (parent/childlink fields not related to
controls I'm modifying)
Tab1 Subform: subfrmRepInfo Control: chkMandated (default =
false)
Tab2 Subform: subfrmPmPlan Control: cboLOM

In an hour of looking on the web and hit-or-miss let's-try-this, the
closest
I've gotten was:
Me.Parent!subfrmpmplan.Form!cboLOM = "MANDATED" which produced
run-time
error 2465 "can't find the field 'subfrmPmPlan' referred to in your
expression"


That error indicates that the name of the subform
**control** is not subfrmRepInfo.

Although that would probably be the name Access created if
the control were added to the main form by dragging a form
object from the db window and dropping it on the main form,
that is not guaranteed. For example, if you use the tool
box, Access just uses a generic name that has no
relationsihp to the name of the form object that you specify
in the subform control's SourceObject property.

After you get the proper value assigned to the combo box,
you can lock it:

Me.Parent!subformcontrolname.Form!cboLOM = "MANDATED"
Me.Parent!subformcontrolname.Form!cboLOM.Locked = True
 
E

eos

AUTO-REPLY From George Levitt

Please allow this to confirm a system receipt of your e-mail.

I am out of the office until Wednesday morning (1/12/05) and will not be
reviewing or responding to email or voicemail until that time.

I look forward to replying to your message on Wednesday.

Thanks and warmest regards, George
 
E

eos

AUTO-REPLY From George Levitt

Please allow this to confirm a system receipt of your e-mail.

I am out of the office until Wednesday morning (1/12/05) and will not be
reviewing or responding to email or voicemail until that time.

I look forward to replying to your message on Wednesday.

Thanks and warmest regards, George
 
E

eos

AUTO-REPLY From George Levitt

Please allow this to confirm a system receipt of your e-mail.

I am out of the office until Wednesday morning (1/12/05) and will not be
reviewing or responding to email or voicemail until that time.

I look forward to replying to your message on Wednesday.

Thanks and warmest regards, George
 
E

eos

AUTO-REPLY From George Levitt

Please allow this to confirm a system receipt of your e-mail.

I am out of the office until Wednesday morning (1/12/05) and will not be
reviewing or responding to email or voicemail until that time.

I look forward to replying to your message on Wednesday.

Thanks and warmest regards, George
 
E

eos

AUTO-REPLY From George Levitt

Please allow this to confirm a system receipt of your e-mail.

I am out of the office until Wednesday morning (1/12/05) and will not be
reviewing or responding to email or voicemail until that time.

I look forward to replying to your message on Wednesday.

Thanks and warmest regards, George
 
E

eos

AUTO-REPLY From George Levitt

Please allow this to confirm a system receipt of your e-mail.

I am out of the office until Wednesday morning (1/12/05) and will not be
reviewing or responding to email or voicemail until that time.

I look forward to replying to your message on Wednesday.

Thanks and warmest regards, George
 

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