I have a form where after I input some data there is a command button that will save the record and close the form. I have tried to write code that based on the FracID of the form it will open a record set in another table and change the value of the yes/no field to yes or true.
My code is as follows:
Private Sub cmdCloseDFIT_Click()
On Error GoTo Err_cmdCloseDFIT_Click
'Close the form, update the DFIT table
'and change the FracInfo table field HasDFIT
'to True if a record is present in the DFIT table
Dim rst As DAO.Recordset
Set rst = CurrentDb.OpenRecordset("FracInfo"
rst.Index = "FracID"
rst.Seek "=", "FracID"
rst.Edit
rst!HasDFIT = "True" 'problem occurs here as datatype
'conversion error
rst.Update
DoCmd.Close
Exit_cmdCloseDFIT_Click:
Exit Sub
Err_cmdCloseDFIT_Click:
MsgBox Err.Description
Resume Exit_cmdCloseDFIT_Click
End Sub
I have tried True, Yes, -1, 1 with and without quotes but still get the Datatype conversion error.
What's the problem???
My code is as follows:
Private Sub cmdCloseDFIT_Click()
On Error GoTo Err_cmdCloseDFIT_Click
'Close the form, update the DFIT table
'and change the FracInfo table field HasDFIT
'to True if a record is present in the DFIT table
Dim rst As DAO.Recordset
Set rst = CurrentDb.OpenRecordset("FracInfo"
rst.Index = "FracID"
rst.Seek "=", "FracID"
rst.Edit
rst!HasDFIT = "True" 'problem occurs here as datatype
'conversion error
rst.Update
DoCmd.Close
Exit_cmdCloseDFIT_Click:
Exit Sub
Err_cmdCloseDFIT_Click:
MsgBox Err.Description
Resume Exit_cmdCloseDFIT_Click
End Sub
I have tried True, Yes, -1, 1 with and without quotes but still get the Datatype conversion error.
What's the problem???