Field value "904235-2" updates as subtraction! Errr!!

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have an insert into statement that takes a value from a listbox and puts it
in a new table where more fields will be manually typed in on another form.

The field "Oracle" represents two fields in one, hence the hypen.

But the insert into puts it in the new table as a subtraction value.

So, Field value "904235-2" updates as "904233" which is subtraction of the
digits on the left side of the hypen minus the digits on the right side of
the hypen!!

I have tried changing the field type from "text" to "number" in the new
table, but that doesn't work. What do I need to do?

Thanks in advance for your help!!
 
worksfire1 said:
I have an insert into statement that takes a value from a listbox and puts it
in a new table where more fields will be manually typed in on another form.

The field "Oracle" represents two fields in one, hence the hypen.

But the insert into puts it in the new table as a subtraction value.

So, Field value "904235-2" updates as "904233" which is subtraction of the
digits on the left side of the hypen minus the digits on the right side of
the hypen!!

I have tried changing the field type from "text" to "number" in the new
table, but that doesn't work. What do I need to do?


Make sure that the append query has quotes around the value.
E.g.

INSERT INTO table (filda) Values("904235-2")
 
True, but how do I do that when I am passing the field?

Here is my code. It works except for it does that crazy subtraction on the
first field!
db.Execute "INSERT INTO tblTest " & "([Oracle#],[Second])" & "VALUES(" &
ctl.ItemData(varItem) & "," & ctl.Column(6, varItem) & ")"
 
You have to provide them along with the value:

.... & ",""" & ctl.Column(6, varItem) & """)"
--
Marsh
MVP [MS Access]

True, but how do I do that when I am passing the field?

Here is my code. It works except for it does that crazy subtraction on the
first field!
db.Execute "INSERT INTO tblTest " & "([Oracle#],[Second])" & "VALUES(" &
ctl.ItemData(varItem) & "," & ctl.Column(6, varItem) & ")"


Marshall Barton said:
Make sure that the append query has quotes around the value.
E.g.

INSERT INTO table (filda) Values("904235-2")
 
Back
Top