hey
im trying to enter only 1 thing in the listview i get error object variable
this is the code
tnx for the help
im trying to enter only 1 thing in the listview i get error object variable
this is the code
Code:
If NewRec Then
Dim NewID As Long
NewID = NextID("HairID", "HairDressers")
Dim strSQL As String
strSQL = "INSERT INTO HairDressers "
strSQL = strSQL & "(HairID, HairDressers) "
strSQL = strSQL & "VALUES("
strSQL = strSQL & NewID & ","
strSQL = strSQL & "'" & RplS(Txt(0).text) & "'"
strSQL = strSQL & ")"
CN.Execute strSQL
Set Itm = FrmHairdressers.LsVw.ListItems.Add(, , Txt(0).text, , "hair")
Itm.Tag = NewID
Itm.SubItems(1) = Txt(0).text
If ChkRepeat.Value Then
Txt(0).text = ""
Exit Sub
End If
Else
With FrmHairdressers.LsVw.SelectedItem
strSQL = "UPDATE HairDressers SET "
strSQL = strSQL & "HairName = '" & RplS(Txt(0).text) & "'"
strSQL = strSQL & " WHERE HairID = " & .Tag
CN.Execute strSQL
Txt(0).text = .text
End With
End If
Unload Me