Can't insert data into table

  • Thread starter Thread starter Dou
  • Start date Start date
D

Dou

Have a digital field and two date field in the table.
I want to insert a record into the table using the statement
INSERT INTO, If I only input other data, let the digital field's
textbox and date field's textbox empty,then I can't insert a record
into the table. I have set digital and date field's Required property
to No. How to solve this problem? thanks.
 
Not sure what a "digital" field is, but make sure those fields aren't part
of a required index, or part of a relationship. If they are, they may be
required.
 
It's Numeric and date fields.
These fields aren't part of a required index and a relationship.
There are other fields in the table.
if I open table using the UI and enter a new record leaving the
Numeric and date fields empty, It's ok.
But It can't insert a record into the table using INSERT INTO statement when
input data in the form and leaving the Numeric and date fields
empty.
 
It might be helpfull if you provide your code for us to view. Check your
allow zero length values, allow nulls, etc.
 
MySQL = "INSERT INTO [Equipment] VALUES('" & Me![cbGroupCat] & "','" &
Me![tbEquipNo] & "',""" & Me![tbEquipDesc] & """,""" & Me![tbAssetNo] &
""",""" & Me![tbPartNo] & """,""" & Me![tbModelNo] & """,""" &
Me![tbSerialNo] & """,""" & Me![tbDetails] & """," & tbOriginCost & ",'" &
tbLocation & "',#" & tbPurchasedDate & "#,#" & tbInstalledDate & "#,#" &
tbWarranteeUntil & "#,""" & tbTechFile & """,""" & tbMFR & """,1,#" &
tbOutUntil & "#,#" & tbTakenOut & "#,#" & tbLastReading & "#," &
tbCurrentHours & "," & tbCurrentMiles & "," & tbCurrentKM & ");"

Above is my INSERT INTO code, MySQL is string.
tbOriginCost is numeric field, tbPurchasedDate,tbInstalledDate,
tbWarranteeUntil,tbLastReading,tbOutUntil,tbTakenOut are date field.
These fields leave them empty, then can't insert a record.Why?
 
Back
Top