Hi there the problem.
I am try to add a new data to the "actions" table with the following code. However I kept on getting error message when some of the ID field is null. I hope someone here can help me to solve the problem.
The error i got is Run time error '3421'
Data Type conversion error
Here is my code.......
Dim rs As Recordset
Dim testdate As Date
Dim StrTester, strComments As String
Dim IntResult, IntBuild, RowCount, RowCounter As Integer
'get result and assign them to the Variables
testdate = "" & [txtResult_Date]
StrTester = "" & [CboResult_Tester]
IntBuild = "" & [CboBuild]
IntResult = "" & [CboPassFail]
strComments = "" & [txtComments]
RowCount = Me.ListBulkResult.ListCount
Set rs = CurrentDb.OpenRecordset("Select * from actions")
For RowCounter = 0 To RowCount - 1
rs.AddNew
rs.Fields("Projectid") = Me.ListBulkResult.Column(0, RowCounter)
rs.Fields("scriptid") = Me.ListBulkResult.Column(2, RowCounter)
rs.Fields("Buildid") = "" & IntBuild
rs.Fields("Tested_Date") = "" & testdate
rs.Fields("testerid") = "" & StrTester
rs.Fields("result") = "" & IntResult
rs.Fields("Comments") = "" & strComments
rs.Fields("test_data") = ""
rs.Fields("Fault_No") = ""
rs.Update
Next RowCounter
rs.Close
I am try to add a new data to the "actions" table with the following code. However I kept on getting error message when some of the ID field is null. I hope someone here can help me to solve the problem.
The error i got is Run time error '3421'
Data Type conversion error
Here is my code.......
Dim rs As Recordset
Dim testdate As Date
Dim StrTester, strComments As String
Dim IntResult, IntBuild, RowCount, RowCounter As Integer
'get result and assign them to the Variables
testdate = "" & [txtResult_Date]
StrTester = "" & [CboResult_Tester]
IntBuild = "" & [CboBuild]
IntResult = "" & [CboPassFail]
strComments = "" & [txtComments]
RowCount = Me.ListBulkResult.ListCount
Set rs = CurrentDb.OpenRecordset("Select * from actions")
For RowCounter = 0 To RowCount - 1
rs.AddNew
rs.Fields("Projectid") = Me.ListBulkResult.Column(0, RowCounter)
rs.Fields("scriptid") = Me.ListBulkResult.Column(2, RowCounter)
rs.Fields("Buildid") = "" & IntBuild
rs.Fields("Tested_Date") = "" & testdate
rs.Fields("testerid") = "" & StrTester
rs.Fields("result") = "" & IntResult
rs.Fields("Comments") = "" & strComments
rs.Fields("test_data") = ""
rs.Fields("Fault_No") = ""
rs.Update
Next RowCounter
rs.Close