SQL Percent Problem

D

DS

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
 
R

Ron Weiner

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?
 
E

eos

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Complex If Statement 6
SQL Date Problem 3
SQL Problem 2

Top