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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Set Vaule IIf Is Not Null

Status
Not open for further replies.

johngordon

Technical User
Jun 29, 2002
112
0
0
US
I want to set the value of a field [For] based on a not null value of another field [ShippingMode].

How can I do this?

Mucho Gracias!

John [afro]
 
Just put this line in the AfterUpdate event of the ShippingMode control.

Me.For = Me.ShippingMode

I am what I am based on the decisions I have made.

DoubleD [bigcheeks]
 
Oops, Here's the null logic included:

If Not IsNull(Me.ShippingMode) Then
Me.For = Me.ShippingMode
End If

I am what I am based on the decisions I have made.

DoubleD [bigcheeks]
 
Can Me.ShippingMode be changed to reflect a field from a table? ie [For] field of the [tblQuestionnaire]table.

Mucho Gracias Again!

John [afro]
 
That all depends on what you're looking for from that table.
The DLookup function will return a value from a table based on criteria that you define. I would think that's what you're looking for in this instance.
Without more detail about what exactly you would need to return from the table and why, it's hard to give you a good answer.

I am what I am based on the decisions I have made.

DoubleD [bigcheeks]
 
John

You are in good hands with DoubleD.

However, I will point out that if your field name is [For] that you should perhaps consider changing it.

For is a reserved word used in visual basic and VBA coding, and you can get yourself into trouble down the road.

Richard
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top