BrokenBiker
ManicMechanic
- Local time
- , 19:06
- Joined
- Mar 22, 2006
- Messages
- 128
Like many on this board I've used the mousetrap by GHudson. However, I have two subforms in the main form. This has created a lot of saving. There are three diferent areas to save in now.
One thing I did to reduce the number of times a user has to save his/her records is to incorporate a "new record clause."
Basically:
This has helped considerably, but I've been trying to find ways to incorporate all three 'saves' (the main form and both subforms) into one function. First, I tried to bypass or transfer the Before Update function of the subforms to the main form, but that's proven ineffective.
The next trick was to change the code a little. Instead of trapping the mousetrap in the subforms' Before Update function, I used it to change a field in the main form hoping that this would "dirty" the main form--thereby enacting the main form's mousetrap. No luck there either, I'm afraid.
I tried again to use the subform's Before Update mousetrap to change the main form by using:
only to receive errors.
I've pretty much decided that I'm not gonna figure this one out on my own. I'm hoping someone might have some insight on this. I'm afraid that because of how forms & subforms interact w/ their own Before Update events that this isn't going to be possible, but I'm still hopeful!
Any help is greatly appreciated, even if it's only to tell me that I'm way off track!
One thing I did to reduce the number of times a user has to save his/her records is to incorporate a "new record clause."
Basically:
Code:
If Me.NewRecord Then
Exit Sub
Else
<mousetrap code here>
End If
This has helped considerably, but I've been trying to find ways to incorporate all three 'saves' (the main form and both subforms) into one function. First, I tried to bypass or transfer the Before Update function of the subforms to the main form, but that's proven ineffective.
The next trick was to change the code a little. Instead of trapping the mousetrap in the subforms' Before Update function, I used it to change a field in the main form hoping that this would "dirty" the main form--thereby enacting the main form's mousetrap. No luck there either, I'm afraid.
I tried again to use the subform's Before Update mousetrap to change the main form by using:
Code:
Forms![MainFormName].Dirty = True
only to receive errors.
I've pretty much decided that I'm not gonna figure this one out on my own. I'm hoping someone might have some insight on this. I'm afraid that because of how forms & subforms interact w/ their own Before Update events that this isn't going to be possible, but I'm still hopeful!
Any help is greatly appreciated, even if it's only to tell me that I'm way off track!
