Ask Me Help Desk

Ask Me Help Desk (https://www.askmehelpdesk.com/forum.php)
-   Visual Basic (https://www.askmehelpdesk.com/forumdisplay.php?f=469)
-   -   Visual basic ask question 2010 (https://www.askmehelpdesk.com/showthread.php?t=507423)

  • Sep 14, 2010, 02:20 AM
    rmmal
    visual basic ask question 2010
    Hi. How can I perform search on 'item below re order level' my VB, which was connected to Access? What are the codes? Thank you.

    Dim Result As String
    search = "[Quantity in Stock]" < "[Reorder Level]"
    With Product.Recordset
    .MoveFirst
    .Find Result
    If .EOF Then
    MoveFirst
    MsgBox "Not found."
    End If
    End With

    Ps: the codes above don't work.Error seems to occur on the codes which are bold. Help
    Ms.RMMAL.US
  • Nov 23, 2010, 08:08 PM
    GaryStaunton
    I'm not surprised that you get an error. Do a little research on SQL queries, for example:

    search = "SELECT * FROM TableName WHERE [Quantity in Stock] < [Reorder Level]"

    Then apply this SQL query to an intialised recordset, which you haven't done in the code, so maybe research this topic too. A little reading will give you lots of knowledge. There isn't enough room on this page to teach you database access and SQL queries.

  • Nov 23, 2010, 08:19 PM
    ScottGem

    Are you writing this code in a VBA module within Access or using VB.Net?

    There are several things wrong with that code, but without knowing the platform we can't advise how to fix it.

  • All times are GMT -7. The time now is 04:11 AM.