Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21846

how to insert a single value from 1 form to another only if the text is green

$
0
0
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
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


Viewing all articles
Browse latest Browse all 21846

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>