A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

If subform dirty, field in main form visible



 
 
Thread Tools Display Modes
  #1  
Old November 9th, 2009, 03:16 PM posted to microsoft.public.access.forms
MiataDiablo
external usenet poster
 
Posts: 2
Default If subform dirty, field in main form visible

On my main form (frmBenefits), I have a subform (subActions) that is
continuous. Either when the the subform receives focus or if the
subform is dirty (I don't care which), I would like a field on the
main form (cboStatus) to become visible.

I've googled and googled and can't find when/where to trigger the
event and the proper syntax. Any help and direction is greatly
appreciated!
  #2  
Old November 9th, 2009, 03:29 PM posted to microsoft.public.access.forms
Dirk Goldgar
external usenet poster
 
Posts: 2,529
Default If subform dirty, field in main form visible

"MiataDiablo" wrote in message
...
On my main form (frmBenefits), I have a subform (subActions) that is
continuous. Either when the the subform receives focus or if the
subform is dirty (I don't care which), I would like a field on the
main form (cboStatus) to become visible.

I've googled and googled and can't find when/where to trigger the
event and the proper syntax. Any help and direction is greatly
appreciated!



For showing the combo box when the subform gets the focus, you could use the
subform *control's* Enter event. I'm talking here about the subform control
on the main form, not any of the controls that are actually on the subform.
Anyway, your code would be something like this:

'------ start of code ------
Private Sub subActions_Enter()

Me.cboStatus.Visible = True

End Sub

Private Sub subActions_Exit()

Me.cboStatus.Visible = False

End Sub
'------ end of code ------

The code for the Exit event is because I assume that you want to hide the
combo when the subform doesn't have the focus.

If you want to wait until the subform becomes dirty, you could use the Dirty
event of the subform's SourceObject form, but you'd also have to use some
event of the main form, maybe the Current event, to hide the combo box
again.

--
Dirk Goldgar, MS Access MVP
Access tips: www.datagnostics.com/tips.html

(please reply to the newsgroup)

  #3  
Old November 9th, 2009, 04:07 PM posted to microsoft.public.access.forms
MiataDiablo
external usenet poster
 
Posts: 2
Default If subform dirty, field in main form visible

On Nov 9, 10:29*am, "Dirk Goldgar"
wrote:
"MiataDiablo" wrote in message

...

On my main form (frmBenefits), I have a subform (subActions) that is
continuous. *Either when the the subform receives focus or if the
subform is dirty (I don't care which), I would like a field on the
main form (cboStatus) to become visible.


I've googled and googled and can't find when/where to trigger the
event and the proper syntax. *Any help and direction is greatly
appreciated!


For showing the combo box when the subform gets the focus, you could use the
subform *control's* Enter event. *I'm talking here about the subform control
on the main form, not any of the controls that are actually on the subform.
Anyway, your code would be something like this:

'------ start of code ------
Private Sub subActions_Enter()

* * Me.cboStatus.Visible = True

End Sub

Private Sub subActions_Exit()

* * Me.cboStatus.Visible = False

End Sub
'------ end of code ------

The code for the Exit event is because I assume that you want to hide the
combo when the subform doesn't have the focus.

If you want to wait until the subform becomes dirty, you could use the Dirty
event of the subform's SourceObject form, but you'd also have to use some
event of the main form, maybe the Current event, to hide the combo box
again.

--
Dirk Goldgar, MS Access MVP
Access tips:www.datagnostics.com/tips.html

(please reply to the newsgroup)


Thank you so much, as usual I was killing a gnat with C4.
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 01:02 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.