2 lines of code in a form action

  • Thread starter evilcowstare via AccessMonster.com
  • 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
 
M

missinglinq via AccessMonster.com

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
 
E

evilcowstare via AccessMonster.com

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top