2 lines of code in a form action

  • Thread starter Thread starter evilcowstare via AccessMonster.com
  • Start date Start date
E

evilcowstare via AccessMonster.com

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
 
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
 
Back
Top