Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms Programming / June 2006

Tip: Looking for answers? Try searching our database.

SQL Percent Problem

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
DS - 22 Jun 2006 20:13 GMT
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

 
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.