By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,400 Members | 953 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,400 IT Pros & Developers. It's quick & easy.

Anyone see a problem with this?

Expert 100+
P: 1,892
I'm making an insert and I have two columns that do not insert like the others they are intInitialInspectionLeakageTestID and intTestProcedureID here is the insert statement does anyone see any errors with the syntax or have any idea why the all the fields but these two will insert?

Here is the code ( sorry I have broken it into lines yet ):
Expand|Select|Wrap|Line Numbers
  1. 'Insert
  2. DoCmd.RunSQL "INSERT INTO [TRepairs] (intCustomerID, intProductID, intSerialNumberID, intReturnGoodsAuthorizationID, strCondition, strWarranty, dtmDateReceived, intChessBOMReferenceID, intInitialInspectionLeakageTestID, intTestProcedureID, intTechnicianID, strBadExhaustValve, strBadInletValve, strLooseSleeve, strBadFilter, strBadClampingSleeve, strLooseHandle, strRepairDescription, strJawsWorn, strEndPlay, strWarrantableRepair, dtmRepairDate, strTime) " & _
  3. "VALUES ('" & cmbCustomer & "','" & cmbProduct & "','" & intSerialNumberMaxID & "','" & intReturnGoodsAuthorizationMaxID & "','" & txtCondition & "','" & cmbWarranty & "','" & txtDateReceived & "','" & cmbChessBOMReference & "','" & cmbInitialInspectionLeakageTest & "','" & cmbTestProcedure & "','" & cmbTechnician & "','" & cmbBadExhaustValve & "','" & cmbBadInletValve & "','" & cmbLooseSleeve & "','" & cmbBadFilter & "','" & cmbBadClampingSleeve & "','" & cmbLooseHandle & "','" & txtRepairDescription & "','" & cmbJawsWorn & "','" & txtEndPlay & "','" & cmbWarrantableRepair & "','" & txtRepairDate & "','" & txtTime & "')"
  4.  
Nov 17 '06 #1
Share this Question
Share on Google+
9 Replies


NeoPa
Expert Mod 15k+
P: 31,661
If you tell me there is nothing in all this that doesn't need to be there for the problem to show then I'll look through it all.
Otherwise, I would expect you to follow the instructions here before posting the question.
The reasons why are laid out quite clearly.
Nov 17 '06 #2

Expert 100+
P: 1,892
NeoPa all I am asking is if anyone can see why that insert would not work I don't know why your linking the posting guidelines.
Nov 17 '06 #3

NeoPa
Expert Mod 15k+
P: 31,661
Because in the posting guidelines it requests that non-essential code is removed before posting (See the bits by Queries & Code).
It's good manners, when asking someone to help, not to expect them to wade through a large amount of non-essential text to even get to the problem.

Answering questions does take our experts time - if half the time is taken going through unconnected (with the problem) text then that is time that cannot be spent helping anyone else.

I hope that's clear as it's a very important point that has knock-on effects for all our members, but particularly those who donate their time to help - that's why that thread was posted prominently at the top of the forum.
Nov 17 '06 #4

Expert 100+
P: 1,892
I don't see what is non-essential that is 1 insert statement... Look at my post count, I know how to post and have answered a ton of questions on this site. It may look like there may be non essential code but I'm not going to chop the insert statement up so you can't tell what is going on. The problem is that I have triple checked the form names with what's in the table and can't find any discrepancies, so I don't know why everything but 2 fields will insert.
Nov 17 '06 #5

100+
P: 1,646
I don't see what is non-essential that is 1 insert statement... Look at my post count, I know how to post and have answered a ton of questions on this site. It may look like there may be non essential code but I'm not going to chop the insert statement up so you can't tell what is going on. The problem is that I have triple checked the form names with what's in the table and can't find any discrepancies, so I don't know why everything but 2 fields will insert.
Expand|Select|Wrap|Line Numbers
  1. DoCmd.RunSQL INSERT INTO [TRepairs] 
  2. (intCustomerID
  3. , intProductID
  4. , intSerialNumberID
  5. , intReturnGoodsAuthorizationID
  6. , strCondition
  7. , strWarranty
  8. , dtmDateReceived
  9. , intChessBOMReferenceID
  10. , intInitialInspectionLeakageTestID
  11. , intTestProcedureID
  12. , intTechnicianID
  13. , strBadExhaustValve
  14. , strBadInletValve
  15. , strLooseSleeve
  16. , strBadFilter
  17. , strBadClampingSleeve
  18. , strLooseHandle
  19. , strRepairDescription
  20. , strJawsWorn
  21. , strEndPlay
  22. , strWarrantableRepair
  23. , dtmRepairDate
  24. , strTime) " & _
  25. "VALUES ('" & cmbCustomer & "','" 
  26. & cmbProduct & "','" 
  27. & intSerialNumberMaxID & "','" 
  28. & intReturnGoodsAuthorizationMaxID & "','" 
  29. & txtCondition & "','" 
  30. & cmbWarranty & "','" 
  31. & txtDateReceived & "','" 
  32. & cmbChessBOMReference & "','" 
  33. & cmbInitialInspectionLeakageTest & "','" 
  34. & cmbTestProcedure & "','" 
  35. & cmbTechnician & "','" 
  36. & cmbBadExhaustValve & "','" 
  37. & cmbBadInletValve & "','" 
  38. & cmbLooseSleeve & "','" 
  39. & cmbBadFilter & "','" 
  40. & cmbBadClampingSleeve & "','" 
  41. & cmbLooseHandle & "','" 
  42. & txtRepairDescription & "','" 
  43. & cmbJawsWorn & "','" 
  44. & txtEndPlay & "','" 
  45. & cmbWarrantableRepair & "','" 
  46. & txtRepairDate & "','" 
  47. & txtTime & "')"
  48.  
You appear to have numerc values surrounded with single quotes. Is that what you want to do?
Nov 17 '06 #6

MMcCarthy
Expert Mod 10K+
P: 14,534
I agree with willakawill. You have coded this Insert to put single quotes around all entries. This implies that all all fields are of type text. If this is not the case then see the following:

When passing values to fields of text data type you enclose in single quotes.
When passing values to fieds of date/time datatype you enclose with # characters.
When passing values to fields of number datatype you don't need any extra characters.

Mary


Expand|Select|Wrap|Line Numbers
  1. DoCmd.RunSQL INSERT INTO [TRepairs] 
  2. (intCustomerID
  3. , intProductID
  4. , intSerialNumberID
  5. , intReturnGoodsAuthorizationID
  6. , strCondition
  7. , strWarranty
  8. , dtmDateReceived
  9. , intChessBOMReferenceID
  10. , intInitialInspectionLeakageTestID
  11. , intTestProcedureID
  12. , intTechnicianID
  13. , strBadExhaustValve
  14. , strBadInletValve
  15. , strLooseSleeve
  16. , strBadFilter
  17. , strBadClampingSleeve
  18. , strLooseHandle
  19. , strRepairDescription
  20. , strJawsWorn
  21. , strEndPlay
  22. , strWarrantableRepair
  23. , dtmRepairDate
  24. , strTime) " & _
  25. "VALUES ('" & cmbCustomer & "','" 
  26. & cmbProduct & "','" 
  27. & intSerialNumberMaxID & "','" 
  28. & intReturnGoodsAuthorizationMaxID & "','" 
  29. & txtCondition & "','" 
  30. & cmbWarranty & "','" 
  31. & txtDateReceived & "','" 
  32. & cmbChessBOMReference & "','" 
  33. & cmbInitialInspectionLeakageTest & "','" 
  34. & cmbTestProcedure & "','" 
  35. & cmbTechnician & "','" 
  36. & cmbBadExhaustValve & "','" 
  37. & cmbBadInletValve & "','" 
  38. & cmbLooseSleeve & "','" 
  39. & cmbBadFilter & "','" 
  40. & cmbBadClampingSleeve & "','" 
  41. & cmbLooseHandle & "','" 
  42. & txtRepairDescription & "','" 
  43. & cmbJawsWorn & "','" 
  44. & txtEndPlay & "','" 
  45. & cmbWarrantableRepair & "','" 
  46. & txtRepairDate & "','" 
  47. & txtTime & "')"
  48.  
You appear to have numerc values surrounded with single quotes. Is that what you want to do?
Nov 17 '06 #7

Expert 100+
P: 1,892
Thanks for the help!
Nov 18 '06 #8

MMcCarthy
Expert Mod 10K+
P: 14,534
Thanks for the help!
You're welcome.

Mary
Nov 18 '06 #9

NeoPa
Expert Mod 15k+
P: 31,661
Because in the posting guidelines it requests that non-essential code is removed before posting (See the bits by Queries & Code).
It's good manners, when asking someone to help, not to expect them to wade through a large amount of non-essential text to even get to the problem.

Answering questions does take our experts time - if half the time is taken going through unconnected (with the problem) text then that is time that cannot be spent helping anyone else.

I hope that's clear as it's a very important point that has knock-on effects for all our members, but particularly those who donate their time to help - that's why that thread was posted prominently at the top of the forum.
I would like to apologise to any readers for the tone of this post.
If I was too strong then that's not a good tone to have in these excellent forums.
So please, if anyone that reads it could take note of the content and ignore the tone, that would be great.
Nov 18 '06 #10

Post your reply

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