Can't insert records into the table

D

Dou

In a table, There are Numeric, date and text fields,if I open table using
the UI and enter a new record leaving the
Numeric and date fields empty, It can insert records into a table.
But It can't insert a record into the table using INSERT INTO statement when
input data on the form and leaving the Numeric and date fields
empty. I have set numeric and date field's Required property to No.
How to solve this problem? thanks.
 
D

Dou

My table structure is:

GroupCategory text 50

EquipNo text 15

EquipDesc text 200

AssetNo text 50

PartNo text 50

ModelNo text 50

SerialNo text 50

EquipDetails Memo -

OriginalCost Single 4

Location text 50

PurchasedDate Date/Time 8

InstalledDate Date/Time 8

WarranteeUntil Date/Time 8

TechnicalFile text 100

Manufacturer text 200

OutOfService Integer 2

OutUntil Date/Time 8

TakenOut Date/Time 8

LastReadingDate Date/Time 8

CurrentHours Single 4

CurrentMiles Single 4

CurrentKM Single 4



My SQL statement is:



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 & ");"










±íË÷Òý
 

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