Ask Experts Questions for FREE Help !
Ask
    rmmal's Avatar
    rmmal Posts: 1, Reputation: 1
    New Member
     
    #1

    Sep 14, 2010, 02:20 AM
    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
    GaryStaunton's Avatar
    GaryStaunton Posts: 17, Reputation: 2
    New Member
     
    #2

    Nov 23, 2010, 08:08 PM
    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.

    ScottGem's Avatar
    ScottGem Posts: 64,966, Reputation: 6056
    Computer Expert and Renaissance Man
     
    #3

    Nov 23, 2010, 08:19 PM

    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.

Not your question? Ask your question View similar questions

 

Question Tools Search this Question
Search this Question:

Advanced Search

Add your answer here.


Check out some similar questions!

Visual Basic [ 3 Answers ]

hi, I am using Access as my DB. I want to save a value in one table in DB. But the value am saving shd exists in database in another table. i.e. that value hs to be compared with the other table .Only if it exists then it has to be saved. How to do it.

Visual basic [ 1 Answers ]

I made this code to save text file. But now I am wondering how to save a file if there is an existing file name. I would like to add a mnuItemSave for that. Is it work? How to code that? Private Sub mnuItemsave_Click() CommonDialog1.Filter = "Text files (*.TXT)|*.TXT" ...

Visual Basic [ 1 Answers ]

Actually I'm a new user(student) of Visual Basic.So I want to know how I am make a simple calculator in Visual Basic 6?

Visual basic [ 1 Answers ]

How can I disable maximise button of a form but minimise and close button should be enable?


View more questions Search