Ask Me Help Desk

Ask Me Help Desk (https://www.askmehelpdesk.com/forum.php)
-   Visual Basic (https://www.askmehelpdesk.com/forumdisplay.php?f=469)
-   -   Is this Weird Or Am I Missing Sumthing? (https://www.askmehelpdesk.com/showthread.php?t=387635)

  • Aug 17, 2009, 03:36 AM
    Firestorm
    Is this Weird Or Am I Missing Sumthing?
    Here is my code...

    'Works Fine Adding Items
    Private Sub Command1_Click()
    If Text2.Text = "" Then
    MsgBox "Please Enter Item Name"
    Else
    Data1.Recordset.AddNew
    End If
    End Sub

    'Works Fine Updating Items
    Private Sub Command2_Click()
    Data1.Recordset.Update
    End Sub

    'This Is The Problem
    Private Sub Command3_Click()
    Data1.Recordset.Find ("Barcode = 'Text5.text'")
    End Sub

    If i Type 123456789 in the textbox, it returns blank textboxs (There should beItem Code and Stock)

    However, if i change the code to this

    Private Sub Command3_Click()
    Data1.Recordset.Find ("Barcode = '123456789'")
    End Sub

    Then it returns all information regarding that Item?

    Please help me, I need it to locate the item from the Txtbox at runtime, But it will only do it ifthe number required is built in the code??

  • All times are GMT -7. The time now is 01:33 PM.