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

If Then and In between Help

Status
Not open for further replies.

cranebill

IS-IT--Management
Jan 4, 2002
1,113
US
Here is what im trying to do....

If QuotedBy = "Name" And ContactID Is Between 10131 And 10242 Then Me.Text16 = "Text 1","Text 2"

How would i accomplish this with VB?

Quoted by and ContactID values are set earlier in the coding.

Bill
 
If QuotedBy = "Name" then
if (ContactID > 10131) And (ContactID < 10242) then
Me!Text16 = &quot;Text 1&quot; & &quot;Text 2&quot;
end if
end if

That's how i would do it...

that's using the same variable names and every thing you gave me...

hope this helps...

--James
junior1544@jmjpc.net
Life is change. To deny change is to deny life.
 
If you want the result to be Text 1 if the condition is true and Text 2 if the condition is false:

If QuotedBy = &quot;Name&quot; and (ContactID > 10131) And (ContactID < 10242) then
Me!Text16 = &quot;Text 1&quot;
Else
Me!Text16 = &quot;Text 2&quot;
end if

Ken
 
Thanx you guys, Ken your way worked like a charm... James when i tried your way is put the strings together because of the & sign im guessing.

Bill
 
that's the way i thought you were looking for based on the way I read your question... glad you got it though...

--James
junior1544@jmjpc.net
Life is change. To deny change is to deny life.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top