SubForm

RayBan

New Member
Joined
Dec 22, 2016
Messages
37
Does a subform have an On Current event, and if yes, how do you get to it please?

Thanks
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
It's the same as the form.
But you have to get to the Form.Subform.Form properties ... the first form is the main form, it has a subform control, and that control has a form property, which is the form you want to work with here. Sometimes it's easier (if you're working in the gui) to right click on the subform border and select the option to "view form in separate window".
 
Upvote 0
Might that apply to a later Access ? I have version 2003 and a r-click on the subform border in design view shows no "view form in separate window" option.

Is there any other way to get to the code window for subForm on current ? Thanks ! The only events I see are On Exit and On Enter.
 
Upvote 0
It's a matter of trial and error. Hard to describe something that's basically visual but click around the subform control until you find the proper way to select it (rather than something that's in it). You can also click another control and try tabbing until you get to the one you are looking for.
 
Upvote 0
Puzzling.. no problem selecting the subform control / properties. It's after that.. e.g the main form has a Code window for On Current Event, no problem - but the subForm does not. Although I'm told it does, yet my Access 2003 doesn't. If I google this question there's no proper answer either, but lots of people asking !!

So please, can anyone specify it DOES exist and then how to get to it, be much appreciated, Thanks.
 
Upvote 0
I'm using 2007 now, but seem to recall it is the same.
Just click the top left box of the form to select the form, not the control. It is just a form after all.

HTH
 
Upvote 0
OK, one last try! Thanks for the info, but I seem to miss the vital bit somehow. Maybe I should reword the question.
As I select various rows on the [database view] Subform,how (or where) do I execute code triggered by that event?

welshgasman, after opening the Form in design view, there's the Form itself colored Grey, and a big white area for the subForm. Is the "Top Left" you refer to the square where below and to to the right, is the ruler ? From that ALt-Enter shows Properties, and you can get to the Forms On Current event to write code. But that's not the on current event for the subForm. Or is it - with more work somehow ?

Anyway, maybe the question is better now ?
 
Upvote 0
A subform definitely has events because it's a regular form. If you select the subform when in main form design view, the subform control is activated first as evidenced by the orange line around the subform. This exposes events on the property sheet for the subform control. Clicking the subform again makes the subform the active object. You can see the difference in the property sheet - 'Selection Type' combo; the names of the selected objects reflect the clicks.

That being said, IIRC putting your code on the subform will require 2 clicks because the subform control gets the focus first. You might find it works better if coded on the subform control.
 
Last edited:
Upvote 0
]Ok,

I have managed to create your problem, by unselecting 'Subform in a New Window. This icon is in the top right corner of the picture.

FWIW mine has been selected all the time and never realised. :)

See the bottom of this link

https://support.office.com/en-gb/ar...1e74d6f5f06b?ui=en-US&rs=en-GB&ad=GB&fromAR=1

Also, just in case
http://www.access-programmers.co.uk/forums/showthread.php?t=132495


subform_zpsjddb8bhr.jpg
[/URL][/IMG
 
Last edited:
Upvote 0
Sorry guys, somewhere I mentioned I have Access 2003, so I'm not seeing orange bits or the same things you're showing me.

I can select the subform control, and see the properties window (without the events I want) but a second click on it just blanks everything on properties.

OK is there a site I can pay to get this information ? I can get no further until I sort this out and days go by....
 
Upvote 0

Forum statistics

Threads
1,214,653
Messages
6,120,751
Members
448,989
Latest member
mariah3

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top