Go Back   Access World Forums > Microsoft Access Discussion > Forms

 
Reply
 
Thread Tools Rate Thread Display Modes
Old 09-15-2018, 02:27 PM   #1
NT100
Newly Registered User
 
Join Date: Jul 2017
Posts: 110
Thanks: 7
Thanked 0 Times in 0 Posts
NT100 is on a distinguished road
Method tiggered with new event in a subform

I have a main form and a subform, I wanted to know what method will be triggered when i click new in the subform.

I would be grateful for any suggestions.

NT100

NT100 is offline   Reply With Quote
Old 09-15-2018, 02:47 PM   #2
The_Doc_Man
Happy Retired Curmudgeon
 
Join Date: Feb 2001
Location: Suburban New Orleans, LA, USA
Posts: 12,167
Thanks: 57
Thanked 1,124 Times in 1,026 Posts
The_Doc_Man is a splendid one to behold The_Doc_Man is a splendid one to behold The_Doc_Man is a splendid one to behold The_Doc_Man is a splendid one to behold The_Doc_Man is a splendid one to behold The_Doc_Man is a splendid one to behold The_Doc_Man is a splendid one to behold
Re: Method tiggered with new event in a subform

The sub-form's BeforeInsert event is one possibility, but that typically doesn't fire until you actually type something in the new record. It is possible that NO event will fire. It depends on what you meant by your question.

Clarify please: When you say you click "New" in the sub-form... is that a command button you have created or are you clicking the triangle-asterisk in the sub-form's navigation bar. If the latter, you might have no event until you start populating the new record. However, it is also possible that the sub-form's Activate event would fire when the sub-form gains focus. If the sub-form already had focus, maybe not.
__________________
I'm a certified grandpa (3 times now) and proud of it.
Retired over one year and survived being home all day with the wife. She must really love me.
If I have helped you, please either click the thanks or click the scales.
The_Doc_Man is offline   Reply With Quote
Old 09-15-2018, 07:04 PM   #3
NT100
Newly Registered User
 
Join Date: Jul 2017
Posts: 110
Thanks: 7
Thanked 0 Times in 0 Posts
NT100 is on a distinguished road
Re: Method tiggered with new event in a subform

"New" means "New (blank) record" in the sub-form's navigation bar. Pls. see the attached photo.

The user clicks this "New (blank) record" to controls of this "new blank record" on the main form. Then I can validate the values entered in the controls.

The attached photo also shows the controls in the main form for the subform's "New (blank) record".

Thanks in advance.

NT100
Attached Images
File Type: jpg New (blank) record.jpg (97.3 KB, 11 views)

NT100 is offline   Reply With Quote
Old 09-17-2018, 09:06 PM   #4
Pat Hartman
Super Moderator
 
Join Date: Feb 2002
Location: Stratford,Ct USA
Posts: 27,321
Thanks: 13
Thanked 1,396 Times in 1,330 Posts
Pat Hartman is a glorious beacon of light Pat Hartman is a glorious beacon of light Pat Hartman is a glorious beacon of light Pat Hartman is a glorious beacon of light Pat Hartman is a glorious beacon of light Pat Hartman is a glorious beacon of light
Re: Method tiggered with new event in a subform

If the record you are viewing (main form or subform) is dirty - meaning that there is an unsaved modification - then the form's BeforeUpdate and form's AfterUpdate events will fire for that record and then the Current event will fire for the new record. Other events might also fire. For example, a contro's BeforeUpdate and AfterUpdate events as well as lostfocue might fire. Events fire in a proscribed order but ONLY if Access determines that they need to fire. For example, if you change control1 and control2 and then click the new record in the subform, the control level events for control2 have not yet fired so they need to fire before the form level events fire. However if you changed control1, and then moved to control2 but didn't change it, there is no need to fire the control's BeforeUpdate and AfterUpdate events because you didn't modify the control. However, you did enter it so the lostFocus event would need to fire followed by the form level events.

What are you trying to do?

__________________
Bridge Players Still Know All the Tricks
Pat Hartman is offline   Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Cause of 'object can't support this method' error using find method? Margarita Modules & VBA 2 04-11-2012 04:51 AM
OnClick event - pass this control to method mcalex Forms 11 08-04-2010 12:56 AM
Calculation in Subform - Event leaving subform darbid Modules & VBA 12 01-14-2009 10:58 AM
Calculated totals from Subform, normal method is not working any more RECrerar Forms 3 09-11-2008 05:05 AM
Field does not exist: MsgBodyText in subform as value for SendObject method Abiart Modules & VBA 6 11-09-2006 02:47 AM




All times are GMT -8. The time now is 06:33 AM.


Microsoft Access Help
General
Tables
Queries
Forms
Reports
Macros
Modules & VBA
Theory & Practice
Access FAQs
Code Repository
Sample Databases
Video Tutorials

Sponsored Links

How to advertise

Media Kit


Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
(c) copyright 2017 Access World