Solved

Trying to select a value from a dataset.

Posted on 2011-02-11
7
462 Views
Last Modified: 2013-11-05
I have a very basic Windows form that has a connection to a mdb.

I am able to get mu search to work, but once complete I would like to select a value to pass to another function.


Imports System
Imports System.Data
Imports System.Data.OleDb

Public Class Form1

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        'TODO: This line of code loads data into the 'ComputerInverntoryDataSet.Group_computers' table. You can move, or remove it, as needed.
        'Me.Group_computersTableAdapter.Fill(Me.ComputerInverntoryDataSet.Group_computers)

    End Sub



    Private Sub EnterBtn(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles button1.click
        Try
            Me.Group_computersTableAdapter.FillByUserName(Me.ComputerInverntoryDataSet.Group_computers, TextBox1.Text)
        Catch ex As System.Exception
            System.Windows.Forms.MessageBox.Show(ex.Message)
        End Try

    End Sub



End Class

Open in new window

0
Comment
Question by:yo_bee
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
7 Comments
 
LVL 84
ID: 34874521
Select a value from where? If this is on a form, does the user enter/select that value, or are you trying to get to it from a Dataset or something of that nature?

0
 
LVL 83

Assisted Solution

by:CodeCruiser
CodeCruiser earned 250 total points
ID: 34874567
0
 
LVL 22

Author Comment

by:yo_bee
ID: 34874578
Attached is a screenshot Dataseet
0
Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

 
LVL 22

Author Comment

by:yo_bee
ID: 34874789
@LSMConsulting

Yes I am trying to get this from a dataset.
0
 
LVL 22

Accepted Solution

by:
yo_bee earned 0 total points
ID: 34874919
I figured it out with some ideas from the  link

http://mka-soft.com/how-to/29-how-to-display-master-detail-vb-net

The the way I got it to work was to drag one of the columns from the table to the form.
When I select a row the text field populates with the proper value.

0
 
LVL 84
ID: 34874933
Does the user select an item somehow? Is that a DataGridView? If so, are you trying to get the value of one of the Columns in that DataGridView for the currently selected row?
0
 
LVL 22

Author Closing Comment

by:yo_bee
ID: 34904861
From the link from CodeCruiser shed some light on the subject and I was able to apply what I saw.

Thanks
0

Featured Post

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
AutoNumbers should increment automatically, without duplicates.  But sometimes something goes wrong, and the next AutoNumber value is a duplicate.  This article shows how to recover from this problem.
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question