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  

2 lines of code in a form action



 
 
Thread Tools Display Modes
  #1  
Old March 12th, 2007, 02:14 PM posted to microsoft.public.access.forms
evilcowstare via AccessMonster.com
external usenet poster
 
Posts: 136
Default 2 lines of code in a form action

If I want to put two pieces of code under the same action do i just repeat it
or do i need to add a seperate sub or something. for example

I have
Private Sub Form_Current()
operativebutton.Enabled = Not IsNull(operativecombo)
End Sub

and
Private Sub Form_Current()
sitebutton.Enabled = Not IsNull(AddressCombo)
End Sub

in VB they are automatically seperated by a single line, but will they both
run. I ask because the 1st one was working fine, now ive added a second i get
error messages

Thanks

--
Message posted via http://www.accessmonster.com

  #2  
Old March 12th, 2007, 02:38 PM posted to microsoft.public.access.forms
missinglinq via AccessMonster.com
external usenet poster
 
Posts: 545
Default 2 lines of code in a form action

Jsut place all code for the event in the proper sub, i.e.

Private Sub Form_Current()
operativebutton.Enabled = Not IsNull(operativecombo)
sitebutton.Enabled = Not IsNull(AddressCombo)
End Sub

--
There's ALWAYS more than one way to skin a cat!

Answers/posts based on Access 2000

Message posted via http://www.accessmonster.com

  #3  
Old March 12th, 2007, 03:00 PM posted to microsoft.public.access.forms
evilcowstare via AccessMonster.com
external usenet poster
 
Posts: 136
Default 2 lines of code in a form action

Thanks I know it sounded really simple, just wasnt 100% sure

missinglinq wrote:
Jsut place all code for the event in the proper sub, i.e.

Private Sub Form_Current()
operativebutton.Enabled = Not IsNull(operativecombo)
sitebutton.Enabled = Not IsNull(AddressCombo)
End Sub


--
Message posted via http://www.accessmonster.com

 




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 09:09 AM.


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