Populating Datatable based on value of column

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • evilbrat
    New Member
    • Jun 2010
    • 1

    Populating Datatable based on value of column

    I want to begin my question by saying that I have never written VB code prior to about 3 weeks ago; I am a technical writer, so I want to apologize if my terminology is incorrect.

    I'm using Visual Studio 2008 and working in VB.

    I have a windows form that writes user-entered data to an Access database, and from that form, a user can click a "View" toolbar button to call another windows form that will show all the records in the database.

    My database is set up to have a Location column, and on the "Entry" window form, a user can select which of 2 locations to use.

    My "View" window has three tabs: All, Location1, and Location2. Each of the tabs includes a DataGridView control and show almost the same set of columns on the grids.

    I want to be able to show all records in the database on the All tab's grid, all records at Location1 on the Location1 tab's grid, and all records at Location2 on the Location2 tab's grid.

    I have successfully managed to sort this data through the use of a Query (through the tables' Add Query function), but that creates a toolstrip, which I don't want.

    The Query is as follows:

    Code:
    SELECT        JobNumber, Location, AssignedTo, ReceivedDate, PromiseDate, Description, Status, Station, ClientName, JobPriority, Completed, ID
    FROM            WIP
    WHERE        (Location = 'VSL') AND (Completed = False)
    Is there a way to assign that code (or similar code) to the datagridview so it only shows the incomplete VSL records? If so, could someone point me in the right direction?

    Thanks.
Working...