B
BenEl via AccessMonster.com
Hi. I have a form (parent table) with an unbound text box. When the user hits
the "close" button, whatever is written in the text box is put into the child
table. I am getting a type mismatch error and can't figure out what's wrong!
Can someone have a look at my code?
If EnterCommentText.Value <> "" Then
LInsert = "INSERT INTO [tblCommentsHistory] ([Auto Number],
[EnterComments], [UpdateWho])"
LInsert = LInsert & " VALUES (" & [Task Number] & ", " & Replace
(EnterCommentText.Value, "'", """) & ", " & LoggedUser & ")
db.Execute LInsert, dbFailOnError
Form_frmModifyTask.Refresh
EnterCommentText.Value = ""
DoCmd.Close acForm, "frmModifyTask"
Else
DoCmd.Close acForm, "frmModifyTask"
End If
Thanks!
the "close" button, whatever is written in the text box is put into the child
table. I am getting a type mismatch error and can't figure out what's wrong!
Can someone have a look at my code?
If EnterCommentText.Value <> "" Then
LInsert = "INSERT INTO [tblCommentsHistory] ([Auto Number],
[EnterComments], [UpdateWho])"
LInsert = LInsert & " VALUES (" & [Task Number] & ", " & Replace
(EnterCommentText.Value, "'", """) & ", " & LoggedUser & ")
db.Execute LInsert, dbFailOnError
Form_frmModifyTask.Refresh
EnterCommentText.Value = ""
DoCmd.Close acForm, "frmModifyTask"
Else
DoCmd.Close acForm, "frmModifyTask"
End If
Thanks!