Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Next Inner

Next Inner

Scheduled Pinned Locked Moved Visual Basic
databasequestion
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    dadashri
    wrote on last edited by
    #1

    have a form that adds a new date to a sql database. What i want to do is when the user clicks add a new day, it comes up with a text box to add a new day. When the user tabs to the first feild, i want the lost focus to check the combo box to see if the date is already in the list? Private Sub txtFields_LostFocus(Index As Integer) Dim ifeild As Integer Dim flddate As String flddate = frmCashSheet.cmbDate.Text ifeild = Index If ifeild = 0 Then frmCashSheet.txtFields.Item(0).Text = flddate MsgBox "date has been entered already, Please select a new date" frmCashSheet.txtFields(0).SetFocus Else For Inner = 0 To 32 txtFields(ifeild).BackColor = &HFF& Next Inner calculate End If End Sub

    T D 2 Replies Last reply
    0
    • D dadashri

      have a form that adds a new date to a sql database. What i want to do is when the user clicks add a new day, it comes up with a text box to add a new day. When the user tabs to the first feild, i want the lost focus to check the combo box to see if the date is already in the list? Private Sub txtFields_LostFocus(Index As Integer) Dim ifeild As Integer Dim flddate As String flddate = frmCashSheet.cmbDate.Text ifeild = Index If ifeild = 0 Then frmCashSheet.txtFields.Item(0).Text = flddate MsgBox "date has been entered already, Please select a new date" frmCashSheet.txtFields(0).SetFocus Else For Inner = 0 To 32 txtFields(ifeild).BackColor = &HFF& Next Inner calculate End If End Sub

      T Offline
      T Offline
      TheComputerMan
      wrote on last edited by
      #2

      Private Sub txtFields_LostFocus(Index As Integer) This does not appear to be called from anywhere by a handler and has the wrong parameters. Private Sub txtFields_LostFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles txtFields.LostFocus Index would have to come from reading something but I am not sure what from this example.

      D 1 Reply Last reply
      0
      • T TheComputerMan

        Private Sub txtFields_LostFocus(Index As Integer) This does not appear to be called from anywhere by a handler and has the wrong parameters. Private Sub txtFields_LostFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles txtFields.LostFocus Index would have to come from reading something but I am not sure what from this example.

        D Offline
        D Offline
        Dave Kreskowiak
        wrote on last edited by
        #3

        It is correct is he's using VB6.

        A guide to posting questions on CodeProject[^]
        Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
             2006, 2007, 2008

        T 1 Reply Last reply
        0
        • D dadashri

          have a form that adds a new date to a sql database. What i want to do is when the user clicks add a new day, it comes up with a text box to add a new day. When the user tabs to the first feild, i want the lost focus to check the combo box to see if the date is already in the list? Private Sub txtFields_LostFocus(Index As Integer) Dim ifeild As Integer Dim flddate As String flddate = frmCashSheet.cmbDate.Text ifeild = Index If ifeild = 0 Then frmCashSheet.txtFields.Item(0).Text = flddate MsgBox "date has been entered already, Please select a new date" frmCashSheet.txtFields(0).SetFocus Else For Inner = 0 To 32 txtFields(ifeild).BackColor = &HFF& Next Inner calculate End If End Sub

          D Offline
          D Offline
          Dave Kreskowiak
          wrote on last edited by
          #4

          So, where's the code that goes through each item in the ComboBox items and compares the two??

          A guide to posting questions on CodeProject[^]
          Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
               2006, 2007, 2008

          1 Reply Last reply
          0
          • D Dave Kreskowiak

            It is correct is he's using VB6.

            A guide to posting questions on CodeProject[^]
            Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                 2006, 2007, 2008

            T Offline
            T Offline
            TheComputerMan
            wrote on last edited by
            #5

            Oops! Sorry did not twig that.

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups