|
-
Feb 27th, 2006, 02:29 PM
#1
Thread Starter
Member
Update database problem
Please help: Struggling as a beginner in South Africa
Having problems with updating Access database.
I have data in the field(s) and I am trying to update the field with Null, In other words replace the current data witg nothing.
It work if fields are text but not if a number.
Data type in database is Number, Long Integer, not required
Code on form:
Private Sub cmdUpdate_Click()
Data3.UpdateRecord
Data3.Recordset.bookMark = Data3.Recordset.LastModified
updateerror:
MsgBox Err.Description
End Sub
This returns error massage: Data type conversion error
-
Feb 27th, 2006, 02:32 PM
#2
Re: Update database problem
If it is a number, replace it with 0
-
Feb 27th, 2006, 02:39 PM
#3
Re: Update database problem
Are you using an empty string as null ('') or the keyword NULL. Number can be set to NULL by using the word NULL (do not place it inside single qoutes).
Sometimes the Programmer
Sometimes the DBA
Mazz1
-
Feb 28th, 2006, 02:20 AM
#4
Thread Starter
Member
Thanks both but:
Thanks for the reply but replacing will O will not help.
The fields in the database hold case number data and is used on my packing slip to indicate how many cartons are used.
Input 2 cartons
1 case
Replacing second with 0 will show on report as for example:
Packed into: 2 cartons
0
instead of using form calculation to show on report
All packed into 2 cartons
Do not know how to code using Null
-
Feb 28th, 2006, 04:09 AM
#5
Frenzied Member
Re: Update database problem
i suggest you get rid of the data control and start migrating to ado
this link here can help you
http://www.connectionstrings.com
On error goto Trap
Trap:
in case of emergency, drop the case...
****************************************
If this post has been resolved. Please mark it as "Resolved" by going through the "Thread Tools" above and clicking on the "Mark Thread Resolved " option. if a post is helpful to you, Please Rate it by clicking on the Rate link right below the avatar
-
Feb 28th, 2006, 07:38 AM
#6
Re: Thanks both but:
 Originally Posted by RayComp
Thanks for the reply but replacing will O will not help.
The fields in the database hold case number data and is used on my packing slip to indicate how many cartons are used.
Input 2 cartons
1 case
Replacing second with 0 will show on report as for example:
Packed into: 2 cartons
0
instead of using form calculation to show on report
All packed into 2 cartons
Do not know how to code using Null
As you have seen, Null will give you a problem on a number field.
Also, if you have 2 cartons, there wouldn't be a 0 in the field, there would be a 1, right?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|