Hello Ajax,
Thank for your reply. But it was error.
"Runtime Error 438"
Code:
Private Sub cmdInsData_Click()Dim s As String
With Me.Recordset
.MoveFirst
While Not .EOF
If .chkSelected Then s = "," & FacilityItems & s
.MoveNext
Wend
End With
If s <> "" Then s = Mid(s, 2)
And this is mark Code
Code:
Dim strIDs As String
strIDs = Me!Text1 & vbNullString
If Len(strIDs) = 0 Then
strIDs = "," & Me!Id & ","
Else
If InStr(1, strIDs, "," & Me!Id & ",") > 0 Then
'remove it
strIDs = Replace(strIDs, "," & Me!Id & ",", "")
Else
strIDs = strIDs & "," & Me!Id & ","
End If
strIDs = "," & strIDs & ","
Do Until InStr(1, strIDs, ",,") = 0
strIDs = Replace(strIDs, ",,", ",")
Loop
If Right(strIDs, 1) <> "," Then strIDs = strIDs & ","
If Left(strIDs, 1) <> "," Then strIDs = "," & strIDs
If strIDs = "," Then strIDs = ""
End If
Me!Text1 = strIDs
Me.Refresh
End Sub
I dont know where is the problem.