Access 97- if... and if... then Coding

J

jeschaefer

I usea form with check boxes. I have code that If one box is checked
Then change a list to "1"

Private Sub XXX_AfterUpdate()
If (Me.XXX = -1) Then
Me.List117 = "1"
End If

I want to write a code that if two (or more) boxes are checked Then
change list to 2

Private Sub XXX_AfterUpdate()
If (Me.XXX = -1) and
If (If Me.YYY = -1 ) Then
Me.List117 = "2"
End If

I would appreciate any help.
 
J

Jeff Boyce

Have you checked Access HELP for the syntax on the If...Then function?

Perhaps:
If (Me!XXX = -1) And (Me!YYY = -1) Then
'do this
Else
'do that
End If

Regards

Jeff Boyce
Microsoft Office/Access MVP
 

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