Can't insert data into table

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.
 
S

Scott McDaniel

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.
 
D

Dou

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.
 
D

Duane Hookom

It might be helpfull if you provide your code for us to view. Check your
allow zero length values, allow nulls, etc.
 
D

Dou

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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top