MsgBox

  • Thread starter Thread starter Secret Squirrel
  • Start date Start date
S

Secret Squirrel

Ok I thought this was pretty simple but I was wrong. Or maybe I'm just
overlooking something. I'm trying to put an event in the afterupate of my
combo box "EmpName" that will have a msgbox appear if control
"VacationAvailable" = "0".

If Me.VacationAvailable = "0" Then
MsgBox("This Employee has 0 vacation days available. This Vacation
Request cannot be processed", vbOKOnly) = vbOKOnly
Me.Undo
Else

End If

I keep getting a message that says "Function call on left-hand side of
assignment must return Variant or Object". What does that mean?
 
When used with parentheses, MsgBox is a function. You're trying to assign a
value to the function, which isn't allowed.

Try:

If Me.VacationAvailable = "0" Then
MsgBox "This Employee has 0 vacation days available. This Vacation
Request cannot be processed", vbOKOnly
Me.Undo
Else

End If
 

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

Back
Top