Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms / March 2007

Tip: Looking for answers? Try searching our database.

2 lines of code in a form action

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
evilcowstare - 12 Mar 2007 15:14 GMT
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
missinglinq - 12 Mar 2007 15:38 GMT
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

Signature

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

Answers/posts based on Access 2000

evilcowstare - 12 Mar 2007 16:00 GMT
Thanks I know it sounded really simple, just wasnt 100% sure

>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
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.