Results 1 to 2 of 2

Thread: Refine Query

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jan 2010
    Posts
    94

    Refine Query

    Maybe someone could save me some time
    Im trying to learn as I go and reached a sticking point that I'm
    having a problem finding a direct answer to on the web
    I want to refine a query and update a record (or records if possable)
    Notes are in the following code
    Thanks For your help

    Code:
        Private Sub Form4_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
           
    
            Do
    
    
    
                Me.Show()
                Me.Activate()
                Dim BARCODE As String = InputBox("Enter Equipment Barcode")
                'storing the text entered in a string
                If BARCODE <> "" Then
    
                    
                    'Load the Record into my form
    
                    'I Want To only Get a Record if the RETURNDATE Colum is blank
    
    
                    'My fillby query is Select F1,F2...Ect FROM SignedOutEquipment
                    '                    WHERE (BARCODE=@BARCODE)
                    '                   And Works Fine
    
    
    
                    Try
                        Me.SignedOutEquipmentTableAdapter.FillBy(Me.SignoutDataSet.SignedOutEquipment, BARCODE)
                        If Me.SignoutDataSet.SignedOutEquipment.Rows.Count = 0 Then
                            MsgBox("That Item Was Not Signed Out", MsgBoxStyle.Critical, "Barcode Not Signed OUT")
                            Me.Close()
                        End If
                        'Here I insert todays date into the form
                        Dim now As Date = Date.Now
                        now.ToString("F")
                        RETURNDATE.Text = now
    
    
                        'Now I want to Update the record with the RETURNDATE Field
                        'and save it back to the Database
    
                    Catch ex As System.Exception
                        System.Windows.Forms.MessageBox.Show(ex.Message)
    
    
                    End Try
    
                   
    
                Else : Me.Close()
                    Exit Do
                End If
    
            Loop
        End Sub

  2. #2
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339

    Re: Refine Query

    WHERE RETURNDATE IS NULL --Assuming it is actually Null/Blank and not ''

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width