473,396 Members | 2,011 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Error Null Type Conversion

17
I'm using Microsoft Access to try to put together a form that enters data into a table when the form is closed, not a typical live form. Several fields are combo lists that pull from various queries. When I execute the code, I keep getting this error:

1 field(s) set to Null due to type conversion.

Here's the code:

Expand|Select|Wrap|Line Numbers
  1. Dim strSQL As String
  2. Dim Eff_Date As Long
  3. Eff_Date = Me.Eff_Date
  4.  
  5. strSQL = "INSERT INTO tblMPR_Price([MPR_ID],[SKU],[Discount],[Eff_Date]," & _
  6. "[DeadOld],[DeadNew],[MAPOld],[MAPNew],[InvOld],[InvNew],[Rate]) " & _
  7. "VALUES ('" & Me.[MPR_ID] & "','" & Me.[SKU] & "','" & Me.[Discount] & "'," & Eff_Date & _
  8. ",'" & Me.[DeadOld] & "','" & Me.[DeadNew] & "','" & Me.[MAPOld] & _
  9. "','" & Me.[MAPNew] & "','" & Me.[InvOld] & "','" & Me.[InvNew] & _
  10. "','" & Me.[Rate] & "');"
  11.  
  12. DoCmd.RunSQL strSQL
  13.  
Here's the field types.

Dead*, MAP* and Inv* fields are currency
Rate is Number
Eff_Date is Date
MPR_ID is Number
SKU and DISCOUNT are Text

I've noticed it seems to be linked to if the "DeadOLD" and "MapOLD" fields have a null value (since the value is populated by a query, if there's no match in the product type, no OLD pricing is pulled). Any ideas on how to handle this? The data gets tansferred still, it's just a nuissance.
Aug 2 '07 #1
1 1975
Rabbit
12,516 Expert Mod 8TB
'Single Quotes Mean Text'
#Hash Signs Mean Date#
And no surrounding characters means it's a variable or a number.
Aug 2 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Paul M | last post by:
I encountered the following error when trying to perform a SQL UPDATE to a MySQL database table from Python. I would apprciate any assistance. In the Python code I have tried integer and decimal...
1
by: Amir | last post by:
Hi all, I have a table called PTRANS with few columns (see create script below). I have created a view on top that this table VwTransaction (See below) I can now run this query without a...
102
by: junky_fellow | last post by:
Can 0x0 be a valid virtual address in the address space of an application ? If it is valid, then the location pointed by a NULL pointer is also valid and application should not receive "SIGSEGV"...
14
by: sachin_mzn | last post by:
Hi, Why I am not getting any run time error while accessing a freed memory in following code. This is printing h in std output. #include<stdio.h> main() { char* buffer = (char*)malloc(6);...
9
by: Ben Midgley | last post by:
Please have a look at the code below My problem is the error message "Nonportable pointer conversion", so far as I can tell there is no pointer conversion occuring here so I am assuming it is...
1
by: Larry Foulkrod | last post by:
When trying to compile my application, the following line of code give me a syntax error: CaseAffiliation affiliation = (dataArray.GetType() == System.Type.GetType("DbNull")) ? null :...
6
by: jasn | last post by:
Hello I am getting the following error message when I try and send an XML sting to a web service, I read somewhere that most web services prefer ascii and some throw errors when using unicode so...
64
by: yossi.kreinin | last post by:
Hi! There is a system where 0x0 is a valid address, but 0xffffffff isn't. How can null pointers be treated by a compiler (besides the typical "solution" of still using 0x0 for "null")? -...
1
by: suslikovich | last post by:
Hi all, I am getting this error when insert values from one table to another in the first table the values are varchar (10). In the second they are datetime. The format of the data is mm/dd/yyyy...
2
by: teddybyte | last post by:
my script below is: #include "stdafx.h" int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.