converting number to text

Results 1 to 5 of 5

Thread: converting number to text

  1. #1
    Tara Guest

    Default converting number to text

    I have a field that is an autonumber field and I want to copy the contents of that field to a password field to create a temporary password that they can later go in and change. This field is a text field. It&#039;s giving me a type mismatch when I try to say:<BR>CompanyRS("PASSWORD")=CompanyRS("ID")<BR>H ow do I make it treat the number like text?

  2. #2
    Join Date
    Dec 1969

    Default RE: converting number to text

    VBScript :<BR>CompanyRS("PASSWORD")=CStr(CompanyRS("ID"))<B R><BR>JScript :<BR><BR>CompanyRS("PASSWORD") = new String(CompanyRS("ID"));<BR><BR>j<BR><BR>

  3. #3
    Tara Guest

    Default RE: converting number to text

    I tried this:<BR><BR>VBScript : <BR>CompanyRS("PASSWORD")=CStr(CompanyRS("ID")) <BR><BR>and get a type mismatch error. Could it be because it&#039;s trying to copy the autonumber field before the record is actually written or does that matter?

  4. #4 Guest

    Default RE: You got it

    CompanyRS.AddNew &#039; Create the new record<BR>CompanyRs.Update &#039; Append it<BR><BR>CompanyRS("PASSWORD")=CStr(CompanyRS("ID ")) &#039; Retrieve the autonumber<BR>CompanyRs.Update &#039; Save record to update it.<BR>

  5. #5
    Tara Guest

    Default RE: You got it

    Thanks for everyone&#039;s help, but it&#039;s still not working. I guess it&#039;s just time for me to change my thinking and put something else in the password field!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts