Click event for a subform

Atomic Shrimp

Humanoid lifeform
Local time
Today, 14:50
Joined
Jun 16, 2000
Messages
1,954
I've got a form that has a subform showing selected records in a sub-table (the records relate to the record shown in the main table/form).

What I'd like is to be able to click the subform and have it open a new form which would show all related records from the sub-table; this I can do, except for the clicking bit; subforms have no OnClick event and I can't superimpose a transparent button, as it won't let me put the subform behind any other object.

Any suggestions (at the moment, I'm thinking i'll have to put a button below the subform, but I would rather not)
 
Hi Mike

How are you keeping? Well I hope.

So you want to open another form by clicking on a subform. Is your subform viewed as a datasheet or a single form view (or continuous view)? If it is single form view you can use the Detail section and that has an OnClick and an OnDoubleClick event. I would go for a Double-Click ... it's too easy for a user to accidently do a single click and suddenly find themselves somewhere they don't want to be.

If it is a datasheet then you could put in a Double-click for all the fields ... so if they Double_Click anywhere within a row/record the related form at the linked record is opened. In fact what I usually do in this situation is create a User Defined Procedure that does all the linking and opening and call that from the OnDoubleClick event for each field within the record.

HTH

Rich Gorvin
 
Rich, thanks; so blindingly obvious that I couldn't see it (I was looking at the subform's properties as a child object in the main form Doh!)
 
it's actually a continuous form, but it's (intentionally)not editable as a subform, so rather than put something in each control,I can just put a transparent control over all of them and put the event code in that.
 

Users who are viewing this thread

Back
Top Bottom