insert SubDatasheet for forms

smercer

Registered User.
Local time
Today, 17:58
Joined
Jun 14, 2004
Messages
442
Hi all

there is a way to have a plus sign in a table so that when you click on the plus sign all child tables that have the same Id to the primary key will be shown directly under neath the main record.

But that is for tables. Is there a way to have the same for a datasheet nested in a form?

I have tried to change the setting in form properties>>format>>Subdatasheet Expanded set to yes and it does not do any thing. (if you do the same in form view the insert Subdatasheet dialog box appears, but if you try to do it the same as a table and click "OK" Nothing happens.)

Thanks to any one to give this brain time.
 
The best way I've found to do this in the past is to set the table itself as the source object of the subform.

So insert the subform the usual way & right-click and select properties. Then chose the table you want to be displayed.

BUT remember you cannot build a link between unbound forms, :( therefore the normal conventions apply and you'll need common data between the form and this subform to use as the CHILD and MASTER fields.

Hope this helps,

Rusty
:D
 
Ahh so that's how you do it. but how do you use events if you do this? (I want to use the OnCurrent event)

Thanks rusty.
 
Last edited:
Glad it worked mate.

I've looked again at this and the only events available to code are "On Enter" and "On Exit". This is a symptom of using the table as the source object. :(

What were you trying to do with the On Current event? Could it be covered in the On Current event of the main form?

Cheers,

Rusty
:D
 
Rusty said:
What were you trying to do with the On Current event? Could it be covered in the On Current event of the main form?
:D


That is a good idea, What I what to do with it is change record in another subform in the same form each time the user changes focus on a recordset.

***Edited***
I have fixed the other problem with the form not changing and have taken out the link
***End Edit***
Thanks for your input rusty :)
 
Last edited:
Rusty said:
What were you trying to do with the On Current event? Could it be covered in the On Current event of the main form?


No I do not think that will work. I do need the OnCurrent. thanks anyway rusty for helping :)
 
Expandable sub-datasheets in subforms

You've probably sussed this already, but in case you haven't here's how:

You've got a main form with several subforms on it. You want one of these (subform_1) to show a sub-datasheet when the [+] at the left end of a record is clicked.

What to do is: make subform_1 a mainform/subform too, that is, subform_1 has a subform of its own (subform_1_subform). When subform_1 is set to display as a datasheet, the subform you set up for it (subform_1_subform) is what will show up as the sub-datasheet when [+] is clicked, and subform_1's record is expanded.

You can use the Form_Current events of subform_1 and subform_1_subform to respond to the user's navigation in the subform or in the subform's sub-datasheet.

In case this doesn't make much sense, I've attached a sample Access 2000 database that does roughly what I think you were wanting to do.

Cheers

Adam
 

Attachments

Thanks alot Adam, your blood is worth bottling.

It fixed the problem. I had thought about it and forgot again, and did not try it out yet.

thanks again!!
scott
 

Users who are viewing this thread

Back
Top Bottom