Replace value

Aleks
Aleks used Ask the Experts™
on
I have the current code. The value passed is "Male" or "Female", but I need to change it to "1" or "2" accordingly.

This is my current code (Passes "Male" or "Female"

strXML2 = strXML2 & buildXML( "1petitionerdad.Gender" , rs_father_petitioner("Sex"), "" )

I am trying this:

     if rs_father_petitioner(campos(i)) = "Male" then
        strXML2 = strXML2 & buildXML( "1petitionerdad.Gender" , "1", "" )
        elseif rs_father_petitioner(campos(i)) = "Female" then
        strXML2 = strXML2 & buildXML( "1petitionerdad.Gender" , "2", "" )
     end if

But for some reason it is not working. Any ideas why ?
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Ryan ChongSoftware Team Lead

Commented:
check what is needed for function: buildXML

and what's the value returned for: rs_father_petitioner(campos(i))

and use something like this:

 strXML2 = strXML2 & buildXML( "1petitionerdad.Gender" ,rs_father_petitioner(campos(i)) , "" )
Web Ninja at large
Commented:
Hard code the recordset:

if rs_father_petitioner("sex")  = "Male" then

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial