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

Setting value of List Box using PowerScript 1

Status
Not open for further replies.

malleykr

Programmer
Mar 22, 2001
24
US
Hello.

I have a form that requires the user to enter information. One of the fields on each of the records is an approval list box. The values contained are "Proposed"/"N" and "Approved"/"Y". When the user changes the list box to "Approved", I execute a function to verify the other fields. If any of the fields fail their tests, I want to set the list box back to "Proposed" and display an error.

The code is successfully identifying errors and displaying them. It is also displaying "Proposed" in the list box.

The problem I am having is that while "Proposed" is displayed, that is not the actual value of the field. The rest of the fields for the row are still disabled as they would be for "Approved" and if I save the record, it is saved as "Approved".

Here is the code I am using to set the field:

if not b_passed then
dw_entry.setitem(row,"sz_approved","N")
messagebox('Error',sz_validerror)
else
dw_entry.setitem(row,"sz_approved","Y")
end if

Is there something else I need to do to get this to work the way I need it to?

Thanks!
 
This may be happening due to the return code from itemchanged. From your post it sounds as though you are accepting the error condition (and just changing the item if the validation fails). Try placing your setitem in a separate event and then posting it (as appropriate) from itemchanged.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top