help with if statement

E

edward keith

I have a text field that I would like to receive the cureent date if the user
selects "order placed" from the combo box. the following is what i tried and
it won't show the date. can you tell me what i am missing. Thank you for
your help
If cboPoOrdered = "Order Placed" Then
Me.OrderDate = Date
Else: OrderDate = Null
 
D

Dan

If Me!cboPoOrdered = "Order Placed" Then
Me!OrderDate = Date
Else
Me!OrderDate = Null
End If
 
E

edward keith

Hi, Dan thanks for reply,
I copied and pasted this code but it still did not put the date in, any more
suggestions? Thanks
 
D

Dan

I'd put a breakpoint on the If statement to be sure that the event is
triggered. Then step through and see what it's doing. In immediate mode you
can also examine the value of Me!cboPoOrdered.

Are you getting an error message?
 
D

Dan

Another thought just occurred to me, is cboPoOrdered a combo box on a lookup
table? If so the value may be the foreign key rather than the text "Order
Placed". If that's the case replace the "Order Placed" with the ID number in
the If statement.
 
E

edward keith

That was it thanks for your help !!

Dan said:
Another thought just occurred to me, is cboPoOrdered a combo box on a lookup
table? If so the value may be the foreign key rather than the text "Order
Placed". If that's the case replace the "Order Placed" with the ID number in
the If statement.
 
Top