Date:  05/12/2004 09:03:53 AM Msg ID:  002049
From:  Joe Goldsmith Thread:  002021
Subject:  Re: SELECT/OPTION
Yes, you are right and I found that earlier but somehow posted the STR(GCOMMISSION,3,2) instead. I see no reason why this should not work. I had it working in VFP for many years and now it fails. I know there is something stupid I am either not doing or overlooking. The saga continues.
 
Joe
Sent by FoxWeb Support on 05/08/2004 11:25:49 AM:
You need to use STR(GCOMMISSION,4,2).  The second argument is the total number of characters, including the period.

FoxWeb Support Team
support@foxweb.com email

Sent by Joe Goldsmith on 05/07/2004 10:10:58 PM:
It seems that select/option may not like numeric value converted to character. Here is my code.
 
*** GCOMMISSION is stored as a numeric with a value of 0.90
*** START EDIT FORM ***
*** Set The Vars
M.GCOMMISSION = STR(GCOMMISSION,3,2)
 
*** The Edit Form
<FORM>
  <SELECT NAME="gcommission" SIZE="1">
  <OPTION VALUE="0.85" <%=IIF(M.gcommission='0.85', 'SELECTED', '')%>>0.85</OPTION>
  <OPTION VALUE="0.90" <%=IIF(M.gcommission='0.90', 'SELECTED', '')%>>0.90</OPTION>
  </SELECT>
  <INPUT TYPE=SUBMIT NAME=btnchoice VALUE="Update">
</FORM>
 
The problem is that 0.90 is never automatically selected and it form always loads with 0.85. In the add form I am able to properly save the commission but the edit form fails. Am I missing something?
 
Joe