Can't insert records into the table

  • Thread starter Thread starter Dou
  • Start date Start date
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.
 
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 & ");"










±íË÷Òý
 
Back
Top