Missing syntax?

Badvoc

Registered User.
Local time
Today, 23:04
Joined
Apr 22, 2009
Messages
69
Iv got a form with two combo boxes (combo0 & combo6) depending on whats in them I want command buttons to be visible or not.
Now the first 2 IF statements work fine but the last 2 ones with the added OR statement aren’t playing ball.
Im sure it’s a simple fix but I cant see it.

Thanks

Private Sub Combo6_Afterupdate()

If Me.Combo6 = "Department" And Me.Combo0 = "All" Then
Me.cmdAllDept.Visible = True
Else
Me.cmdAllDept.Visible = False
End If
If Me.Combo6 = "Individual" And Me.Combo0 = "All" Then
Me.cmdAllInd.Visible = True
Else
Me.cmdAllInd.Visible = False
End If
If Me.Combo6 = "Department" And Me.Combo0 = "Tasks In" Or "Finished Late" Or "Finished on Time" Or "Outstanding" Then
Me.cmd17.Visible = True
Else
Me.cmd17.Visible = False
End If
If Me.Combo6 = "Individual" And Me.Combo0 = "Tasks In" Or "Finished Late" Or "Finished on Time" Or "Outstanding" Then
Me.cmd29.Visible = True
Else
Me.cmd29.Visible = False
End If
End Sub
 
Try:
If Me.Combo6 = "Department" And (Me.Combo0 = "Tasks In" Or Me.Combo0 = "Finished Late" Or Me.Combo0 = "Finished on Time")
 
Tried that, and using [ ] aswell.

it just seems to miss the 3rd IF statment and only run the first 2 and last 1.
 
Have you single stepped the code to see what is happening?
 
if you mean by "single step" to not use the OR and write each out as IF statments then yep that had the same effect, just run the last IF statement.
 
No, I mean putting a breakpoint in the code and using F8 to execute one line at a time.
 
While looking at the code, left click outside of the left margin to set a breakpoint, then rin the form. The code will stop on that line and pressting F8 will advance one line at a time.
 
Iv tried to attach the form with a couple of table needed to run it,
 

Attachments

Doh!
or me.combo0 and the ()
I thought it was a simple fix.

Magic your a star RuralGuy...
 

Users who are viewing this thread

Back
Top Bottom