Which Parent Form Event is Triggered When Subform is Entered? - forms

I have a main/parent form with multiple subforms and the main form fields are locked until the user clicks an "Edit" button. This triggers an event which unlocks the fields.
When the user selects one of the subforms, I'd like to lock the fields again, but cannot find which main form event is triggered when activating the subform. It doesn't appear to be LostFocus or Deactivate.
Which event on the parent form is triggered when one of its subforms is activated/entered?

It is the OnEnter and OnExit events of the subform control on the parent form.

Related

Modify a control's action in an inherited form so that it acquires the new action's events

I have an ancestor form with some controls on it, some of them are associated with actions so they "acquire" their action's events (i.e. a button acquires the action's OnExecute event on its OnClick event).
Then I have another form that inherits from this one. I want one of the inherited buttons to behave differently from what's in the ancestor (yes I know, this is not good practice, but let's concentrate on the topic), so I create a new action and its OnExecute event, then set the button's action to the new one. Check if the button's OnClick event points to the new OnExecute event handler and it seems all fine.
Run the program, click on the button and surprise, the executed code is the one from the ancestor's action, not my new one!
Double check the new form, seems ok... But if I close and reopen it in the IDE, I can see the OnClick event handler of my button actually points to event handler acquired from the ancestor action, not from my new one.
The problem probably lies on the fact that the OnClick event handler, being acquired from the action, is not written to the DFM file, so when my inherited form is loaded, the OnClick event on my button isn't defined and is inherited from the ancestor form. Am I correct?
But then, how can I solve this problem?

can't make child form stay on top in MS access

I have a full-screen form (using popup) which contains a button that launches a child form. I read that I have to set the child form as popup to make it stay on top. I've done that, but it is still not working. After more googling around, I found out that it's not working because the parent form is also set to popup. How to solve this problem with maintaining the parent form in full screen mode?
As I understood, you need to open child form and it should stay above main form. Both forms should be popup, but if the size of child form will be less than main form, user can click on main form and child form disappears under main one even if child form has Modal property. If you don't want this, just open child form with acDialog WindowMode parameter.

Mouse Scroll with 1 Main Form and 2 subforms MS ACCESS

I have a MS ACCESS 2007 form with 2 subforms. I have a few fields from the main form as text, a few on the second form as text, and a lot on the third form as a variety of things.
My problem with these subforms, when I am entering data in the main form, my mouse scroll works just fine to scroll to the bottom of the form. When I am in subform 1 or 2, my mouse scroll stops working to scroll down to the bottom of the main form. I tried looking up disabling mouse scrolling but that's already preset for a single form view in MS Access 2007. I just want the mouse scroll to work only for the general form even if you are doing data entry into subform 1 and 2.
I know it's been a while since your post. But I've had nearly the same problem and figured it out, so thought I'd post the answer anyway:
If you make an extra textbox in your main form (make sure it's property visible is set to TRUE), then place this textbox behind any other control so to the user it seems like there is no textbox.
Now in the properties of the details selection of the mainform make an onClick event (this occures when you click anywhere in the mainform). In this event use the SetFocus method which redirects to the textbox made earlier. The code looks like this:
[Forms]![MAINFORM]!TEXTBOX.SetFocus
If you click on the form (outside the subforms) the textbox gets selected automatically, which allows you to scroll the main form. The user doesn't see the textbox so it seems as if he/she selected the mainform.
Hope it helped!

Create a navigation window in Access

I'm looking to create "Welcome" window of sorts for the database I'm working on. The window would have four buttons. My current issue is with a button that I want to use to open a form I've already created.
The trick is this form is meant to be the input window to a table, so I don't want the form to come pre-populated with any data, it would (if completed) create a new record, but only once the form is completed.
Opening the form isn't the trouble (DoCmd.OpenForm "form name"), what I'm not sure is how to have it open blank.
DoCmd.OpenForm "form name",,,,acFormAdd
This opens the form to a "new" record.
If the form is bound to a table, then you can open it to a "new" record but that record is added to the database as soon as the first value is input. This doesn't fit your requirement of the record being added "only once the form is completed".
If the form is unbound, it's technically already on a blank record but you would have to create some event to save that record to the table. That event could be the OnClick event of a button, or the AfterUpdate event of a required field (although the OnClick event of a button is probably the proper method 99.999% of the time).

Requery SubForm after button is clicked on Popup box

I have a navigational Form e.g. MainNavigationForm. It has multiple navigational tabs and one of the tabs have a form e.g. "MainForm". This MainForm have a comboBox where user selects a value. MainForm also has a subform e.g. "SubForm" which is hidden initially. Once user selects something from the comboBox..a Popup form pops up e.g. "PopupForm". User fills in the details on the PopupForm and once the user hits Create button on PopupForm, he should be redirected to MainForm. But this time, the SubForm should be made visible and shown the updated data using requery. So, my question is How can I requery the SubForm from the OnClick event of the Create button which is on the PopupForm??
I hope I am clear in explanation..if not..please ask more..thanks in advance
Got it working..Thanks to SmileyCoder
http://bytes.com/topic/access/answers/907826-how-requery-subform-closing-popup-form
IF your opening your form from code you can simply do:
docmd.OpenForm "frm_Popup",acNormal,,,acFormPropertySettings,acDialog
Me.subFrm.Requery