Change visible subdatasheet in code

A

allen davidson

Hi, I have a simple database with the following basic structure:

-< indicates one to none or many

Organisation -< GeneralQuestionnaire
Organisation -< CarersQuestionnaire
CarersQuestionnaire -< Courses
CarersQuestionnaire -< Commissions

I have various forms that allow the user to navigate the tables and enter
data. So gfar so good. The user wants a way of seeing everything at once,
spreadsheet style. So I thought displaying in datasheet mode was reasonable
but I understand from another post I can only display one subdatasheet at a
time. e.g.

Organisation -< CarersQuestionnaire -< Courses

So I need to toggle the second and third level subdatasheets in code. My top
form for all of this 'frmTop has a subform 'subOrganisationDatasheet' that
displays a form 'frmsOrganisationDatasheet'. The form
'frmsOrganisationDatasheet has two subforms #1 'subCarersQuestionniare'
displays a subform 'frmsCarersQuestionniareDatasheet' #2
'subGeneralQuestionnaire' displays form 'frmsGeneralQuestionnaire'.

I'm not sure how to code switching between the CarersQuestionnaire and
GeneralQuestionnaire particulary unsure about using the subform or form name
and . or !.

My starting guess is:

In frmTop
Me.subOrganisationDatasheet.Form .... then I get lost.

Can anyone help?

Thanks
Allen#




need to
 
A

aaron.kempf

I'd change this to multiple physical forms.

You could have a form that would show subdatasheet 1, 3 and 5.
and then you could have another form that would show subdatasheet 2,
4, and 5.

Thanks

-Aaron
 
B

BruceM

I think you can only display one subdatasheet in a table view, but in a form
you can display more than one subform. If it gets crowded you can put the
subform controls onto separate pages of a tab control. As an alternative
you could toggle the visible property of the subform controls, something
like this in a comman button's Click event:
If Me.Subform1.Visible Then
Me.Subform1.Visible = False
Else
Me.Subform1.Visible
End If
Me.Subform2.Visible = Not Me.Subform1.Visible
 
A

allen davidson

Thanks Aaron & Bruce, I think I was going too quick and dirty and it was
never really going to work. I'll go back to standard forms with multiple many
to one relationships.

Allen
 

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