I have an SQL statement that is getting hung up on the percent field.
The data type in the table is Number, format is percent. The field on
the form is unbound with a percent format, 0 for the decimal places.
Dim PMSQL As String
DoCmd.SetWarnings False
PMSQL = "INSERT INTO PayName " & _
"(PaymentNameID,PaymentName,PaymentType,ExpirationDate,Active,CouponType,CouponWorth,CouponAmount,CouponPercent)
" & _
"Values(" & Forms!CouponNames!TxtID & ",'" &
Forms!CouponNames!TxtName & "'," & 3 & "," &
Format(Forms!CouponNames![TxtExp], "\#mm\/dd\/yyyy\#") & "," &
Forms!CouponNames![ChkActive] & "," & Forms!CouponNames!TxtType & ",'" &
Forms!CouponNames!TxtWorth & "'," & Forms!CouponNames!TxtAmount & "," &
Forms!CouponNames!TxtPercent & ")"
DoCmd.RunSQL (PMSQL)
DoCmd.SetWarnings True
Any help appreciated,
Thanks
DS
Ron Weiner - 23 Jun 2006 18:28 GMT
DS
If the data type in the table is a long (which is the Access default for a
number type field) then you can't store a decimal value in there, and
therefore the lowest percentage you could enter into this field would be a 1
which is 100%. What happens when you change the field to a Double, single,
or Decimal type?

Signature
Ron W
www.WorksRite.com
> I have an SQL statement that is getting hung up on the percent field.
> The data type in the table is Number, format is percent. The field on
[quoted text clipped - 3 lines]
> DoCmd.SetWarnings False
> PMSQL = "INSERT INTO PayName " & _
"(PaymentNameID,PaymentName,PaymentType,ExpirationDate,Active,CouponType,Cou
ponWorth,CouponAmount,CouponPercent)
> " & _
> "Values(" & Forms!CouponNames!TxtID & ",'" &
[quoted text clipped - 9 lines]
> Thanks
> DS
eos - 27 Jun 2006 14:51 GMT
AUTO-REPLY From George Levitt
Please allow this to confirm a system receipt of your e-mail.
I am out of the office until Wednesday morning (1/12/05) and will not be
reviewing or responding to email or voicemail until that time.
I look forward to replying to your message on Wednesday.
Thanks and warmest regards, George