Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Confused on If, Then, Else...

Status
Not open for further replies.

Turb

Technical User
Feb 11, 2003
154
US
Hi all,
I have been trying to get this statement working all morning and I'm at a loss, could someone help please?

I've this statement
Code:
    If Me.ORDTYPE.Value = PDC Then
        DoCmd.RunMacro "Macro4"
    Else
        DoCmd.RunMacro "Macro1"
    End If
under a form in my Db. What I'm trying to do is as the form is closed (or maybe updated - I've tried both) if the field "ORDTYPE" value (from a combobox on the form) is "PDC", macro4 should run, if it's not, macro1 should run.
What am I doing wrong?
Any help would be much appreciated.

-Turb
 
If you mean PDC as a value, you need quotes:

[tt] If Me.ORDTYPE.Value = "PDC" Then[/tt]
 
Geez...
I feel like such a ...

Remou, thank you very much! That did it.

-Turb
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top