Open a form with a sub form

  • Thread starter mark_jm via AccessMonster.com
  • Start date
M

mark_jm via AccessMonster.com

I want to open a form with a subform. On open I want to

parent form to open in edit mode, but the subform to be disabled. Upon the
clicking of a button on the parent form I want the sub form to enable in ad
mode ready to accept a new record.

I cant work out the syntax

I get mixed up when trying to refer to a form on a subform.

Any help appreciated.

Mark
 
E

ErezM via AccessMonster.com

hi
set the subform's DataEntry property to true (so it will be used to add new
data)
set the enabled property of the subform control on the main form to false (so
the subform will be disabled when the form opens)
now add a new command button to the main form and set it's click event to
subFormControlNameComesHere.Enabled=True

good luck
Erez
 
M

mark_jm via AccessMonster.com

I tried a few things.

I tried
[Forms]![recon system create form].[Form]![recon system create subform].
Enabled = True
but access seems to be looking for a field of the same name as my subform
instead of looking for the form?

I tried
[SubForm] [recon system create subform].Enabled = True

It errored " cant find the field "|" as refeed to in your expression


any ideas?

Mark said:
hi
set the subform's DataEntry property to true (so it will be used to add new
data)
set the enabled property of the subform control on the main form to false (so
the subform will be disabled when the form opens)
now add a new command button to the main form and set it's click event to
subFormControlNameComesHere.Enabled=True

good luck
Erez
I want to open a form with a subform. On open I want to
[quoted text clipped - 9 lines]
 
M

mark_jm via AccessMonster.com

Ive also tried
Forms.[recon system create form].[recon system create subform].Form.Enabled =
True
this errors object dosnt support this property or method.

My form has a query as its data source, the sub form has a table, is this any
thing to do with it?

mark_jm said:
I tried a few things.

I tried
[Forms]![recon system create form].[Form]![recon system create subform].
Enabled = True
but access seems to be looking for a field of the same name as my subform
instead of looking for the form?

I tried
[SubForm] [recon system create subform].Enabled = True

It errored " cant find the field "|" as refeed to in your expression

any ideas?

Mark
hi
set the subform's DataEntry property to true (so it will be used to add new
[quoted text clipped - 12 lines]
 
E

ErezM via AccessMonster.com

if
main form name = frmMain
subForm control name on the main form (the name of the rectangle containing
the form) = subForm1

if you want to disable/enable the sub form from code inside the main form:

subForm1.Enabled=False/True

if you want to disbale/enable the sub form from another, seperate form:

Forms!frmMain!subForm1.Enabled=False/True

in both cases it's the control containing the subform that is
enabled/disabled and not the form inside it, but it should prevent access to
the subform anyway, which is what you want, no?

Erez

mark_jm said:
Ive also tried
Forms.[recon system create form].[recon system create subform].Form.Enabled =
True
this errors object dosnt support this property or method.

My form has a query as its data source, the sub form has a table, is this any
thing to do with it?
I tried a few things.
[quoted text clipped - 17 lines]
 
M

mark_jm via AccessMonster.com

I think its the bit about the frame around the form that has been throwing me
off the scent

I will try this again

Thanks

Mark
if
main form name = frmMain
subForm control name on the main form (the name of the rectangle containing
the form) = subForm1

if you want to disable/enable the sub form from code inside the main form:

subForm1.Enabled=False/True

if you want to disbale/enable the sub form from another, seperate form:

Forms!frmMain!subForm1.Enabled=False/True

in both cases it's the control containing the subform that is
enabled/disabled and not the form inside it, but it should prevent access to
the subform anyway, which is what you want, no?

Erez
Ive also tried
Forms.[recon system create form].[recon system create subform].Form.Enabled =
[quoted text clipped - 9 lines]
 

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