im trying to figure out how can i insert from Appointments a name to the Customers form only if the text is green
before i update the corrent lisview
need some help
so far i did
before i update the corrent lisview
need some help
so far i did
Code:
If TxtDesc.BackColor = &HFF00& Then
MsgBox("this customer seems to be a new customer would you like to insert is name in the customers now?", vbExclamation + vbDefaultButton2 + vbYesNo, "") = vbNo
Cancel = True
Exit Sub
Else
Dim NewID As Long
NewID = NextID("ID", "FullName")
Dim strsql As String
strsql = "INSERT INTO Customers"
strsql = strsql & "(ID,)"
strsql = strsql & "VALUES("
strsql = strsql & NewID & ","
strsql = strsql & "'" & RplS(TxtDesc.text) & "'"
strsql = strsql & ")"
CN.Execute strsql
Set itm = FrmCusts.LsVw.ListItems.Add(, , TxtDesc.text, , "cust")
itm.Tag
End If
End If
MsgBox "Update succes", vbInformation
Unload Me
FrmAppointments.Loadentries