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

Equal values

Status
Not open for further replies.

debbie1212

Programmer
May 31, 2000
66
US
I have some code that I want to run only if a condition is met. The Request Location has to be the same as the User Location. I put the following code:

If (objFolderRequest.intReq_To_Loc = objUserLocation.intLocationID) Then

However it is going into the Else statement as if this condition isn't met. I even did a response write to make sure the condition is met:

Response.Write objFolderRequest.intReq_To_Loc & " = " & objUserLocation.intLocationID

It returns 102 = 102 so they are the same.

Since this condition is met, it should not jump to the Else statement.

I even checked the database to see if one of these fields has any spaces after the number but they don't.

Any ideas?

Thanks,
Debbie
 
try:

If (cint(objFolderRequest.intReq_To_Loc) = cint(objUserLocation.intLocationID)) Then

"did you just say Minkey?, yes that's what I said."

MrGreed
 
why dont you put a trim( ) around the objects....

If (trim(objFolderRequest.intReq_To_Loc) = trim(objUserLocation.intLocationID)) Then

See if that works

JP
_______________________________________________
OutsideIntranets.com
Stop wasting time, get to work
 
The cint worked but the trim didn't.

It's interesting because we have several other places in the code where we do the same thing and they work without the cint. That's why I couldn't figure it out.

Thanks!!!!!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top