A workaround for a character-to-number error that exists when assigning a field with a table associated with it

Source: Internet
Author: User

Rapid development platform, the customer two build development, has a registered person's function, after selecting a post, click on the registered personnel, found sometimes normal, sometimes not normal. The errors that occur when you are not normal are as follows:
650) this.width=650; "id=" aimg_907 "src=" http://bbs.delit.cn/data/attachment/forum/201601/13/ 194401yhomch99w7o934ot.jpg.thumb.jpg "width=" "height=" 126 "alt=" 194401yhomch99w7o934ot.jpg.thumb.jpg "/>

failed to convert parameter value from a string to a int32.
record Part 1. SetFieldValue ("Gangweiid", Me.getparam ("Job ID"))

This error code is found to be assigned to the Gangweiid field of the recording part, so MsgBox (Me.getparam ("Job ID") to see what is passed in, the result of the test is a number. That's strange, why do you occasionally have this character conversion integer error?

after troubleshooting, gangweiid This field, set up his table association, from the Department Post Table Association, and set the association conditions.
the previous code is:

        ' Set the table variable for his position and set the default job ID
zd= Record Part 1. Getcolumnbiztable ("gangweiid")
ZD. Setvariblevalue ("Orgidstr", record Part 1. GetFieldValue ("Suoshubumenid"))        
record Part 1. SetFieldValue ("gangweiid", CInt (Me. GetParam ("Job ID")))


The above code is the first to assign a value to the field's table variable, and then set the value of this field, it may cause the problem of the above diagram.

Corrected code:


record Part 1. SetFieldValue ("gangweiid", CInt (Me. GetParam ("Job ID")))
        ' Set the table variable for his position and set the default job ID
zd= Record Part 1. Getcolumnbiztable ("gangweiid")
ZD. Setvariblevalue ("Orgidstr", record Part 1. GetFieldValue ("Suoshubumenid"))        
        


assign a value to the field before setting a value on the table variable for the field.

and then it's normal.

Original address: http://bbs.delit.cn/thread-611-1-1.html

Reprint please specify the source:

Author: metric Technology http://www.delit.cn

A workaround for a character-to-number error that exists when assigning a field with a table associated with it

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.