Shouldn't this be easy? 
Author Message
 Shouldn't this be easy?

I have a main form with several subforms.  The subforms all refer to one
table, just showing different fields within the one table (some fields are
shown on several subforms).  The subforms are all open at once, I use
command buttons to hide and unhide the various subforms as I want them
displayed.  The problem is, I want the changes made in one subform to be
visible in the other subforms as I hide and unhide each subform.  Because I
am not closing the forms, the changes aren't being posted to the table.  I
want to save the changes to a record on the subform before I hide it, and
make the other subform visible.  Then I could requery the unhidden subform
to reflect the changed data.   Is this the best way to accomplish what I
need to do?  If so, what is the method used to save a record displayed by a
subform (I have searched help extensively)?

Thanks,
Tom



Sun, 26 Nov 2000 03:00:00 GMT  
 Shouldn't this be easy?

Have you tried this?

Sub ButtonHideSubForm_OnClick
    Me!myFormControl.Form.Refresh
    Me!myFormControl.Visible = False
End Sub

Dag

Quote:
Tom Reese wrote.......
>I have a main form with several subforms.  The subforms all refer to one
>table, just showing different fields within the one table (some fields are
>shown on several subforms).  The subforms are all open at once, I use
>command buttons to hide and unhide the various subforms as I want them
>displayed.  The problem is, I want the changes made in one subform to be
>visible in the other subforms as I hide and unhide each subform.  Because I
>am not closing the forms, the changes aren't being posted to the table.  I
>want to save the changes to a record on the subform before I hide it, and
>make the other subform visible.  Then I could requery the unhidden subform
>to reflect the changed data.   Is this the best way to accomplish what I
>need to do?  If so, what is the method used to save a record displayed by a
>subform (I have searched help extensively)?

>Thanks,
>Tom



Mon, 27 Nov 2000 03:00:00 GMT  
 Shouldn't this be easy?

Hi,

I suggest you write a subroutine, in a module, like:

Public Sub RefreshAllForms()
    Forms!FormName1.Refresh
    Forsm!FormName2.Refresh
    ......
End Sub

and then, call that subroutine each time you wish to refresh all the forms.
Alternatively, you can Refresh the desired forms individually.

If a record has been erased or added, you need a Requery instead of a
refresh, but then, you will loose bookmarks and positions.

Hope it may help,
Vanderghast, Access MVP.

Quote:

>I have a main form with several subforms.  The subforms all refer to one
>table, just showing different fields within the one table (some fields are
>shown on several subforms).  The subforms are all open at once, I use
>command buttons to hide and unhide the various subforms as I want them
>displayed.  The problem is, I want the changes made in one subform to be
>visible in the other subforms as I hide and unhide each subform.  Because I
>am not closing the forms, the changes aren't being posted to the table.  I
>want to save the changes to a record on the subform before I hide it, and
>make the other subform visible.  Then I could requery the unhidden subform
>to reflect the changed data.   Is this the best way to accomplish what I
>need to do?  If so, what is the method used to save a record displayed by a
>subform (I have searched help extensively)?

>Thanks,
>Tom



Mon, 27 Nov 2000 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. This shouldn't work, but ...

2. It just shouldn't be this complicated...

3. Forms taking focus when they shouldn't

4. Please Help: Shouldn't this work?

5. Record Locking Shouldn't Be So Hard

6. EZTouchPOS Why you shouldn't buy it

7. It shouldn't have done that...

8. Textbox beeps and it shouldn't

9. Shouldn't this timer go off?

10. VarType 8192 shouldn't be returned

11. MTS commited data when it shouldn't

12. Shouldn't MS combine Access and VB?

 

 
Powered by phpBB® Forum Software