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

Insert Query Problem

Status
Not open for further replies.

nicktred

Programmer
Jan 2, 2004
20
GB
I have an insert statement that doesnt quite work right

**************
Dim strSQL As String
Dim antpost As Double


strSQL = "INSERT INTO shiftcalculations VALUES (1111, " & Me.Ant_PostShift & ", " & Me.sup_infShift & "," & Me.right_leftShift & ")"
CurrentDb.Execute strSQL
***************

It gets the value but rounds it of to the nearest whole number for example if the value is 6.4 it adds it to db as 6.0

I have set decimal places to 1 and this brings up the .0 but seems to be rounding off values before insert

any ideas

cheers

Nick
 
Try to narrow down the problem by setting a break point on the statement

CurrentDb.Execute strSQL

Then examine the value of strSQL.
 
I put a breakpoint in before the insert is done to display the contents on strSQL and it contains the data in the right format without any rounding but still rounds it when it inserts it into the db. #

Nick
 
Check the destination field in the table. Is the field size set to single or double? Is the decimal places property set to something other than zero?
 
Thanks for the help was beign really stupid hadnt set it to double. Thats the prob after working for 8 odd hours straight seem to miss stupid things

thanks again

nick
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top