Jump to content

Welcome to Geeks to Go - Register now for FREE

Need help with your computer or device? Want to learn new tech skills? You're in the right place!
Geeks to Go is a friendly community of tech experts who can solve any problem you have. Just create a free account and post your question. Our volunteers will reply quickly and guide you through the steps. Don't let tech troubles stop you. Join Geeks to Go now and get the support you need!

How it Works Create Account
Photo

Visual Basic Coding Help: My code won't work at all


  • Please log in to reply

#1
Moon_Dew

Moon_Dew

    Member

  • Member
  • PipPip
  • 10 posts
I know I'm doing something wrong here, but my sleep deprived brain (had a minor family crises last night, had to stay up much longer than I normally do) just can't work it out.

The allButton click event is suppose to show all the records in the database, the codeButton click even is supposed to show only the records with a code of PG24, and the nameButton click event is supposed to show only the record with Java in the MagName cell.

Right now the only things working are the database and the exit button.

I'd attach the database, but the file's invalid.

Option Explicit On
Option Strict On
Option Infer On

Public Class MainForm

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

    End Sub

    Private Sub exitButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles exitButton.Click
        Me.Close()
    End Sub

    Private Sub allButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles allButton.Click
        Dim records = From code In MagazinesDataSet.tblMagazine
        Select code

    End Sub

    Private Sub codeButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles codeButton.Click
        Dim records = From code In MagazinesDataSet.tblMagazine
                      Where code.Code.ToUpper = "PG24"
                      Select code

    End Sub

    Private Sub nameButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles nameButton.Click
        Dim records = From magName In MagazinesDataSet.tblMagazine
                      Where magName.MagName.ToUpper = "Java"
                      Select magName
    End Sub
End Class

Edited by Moon_Dew, 07 November 2013 - 06:51 PM.

  • 0

Advertisements


#2
Moon_Dew

Moon_Dew

    Member

  • Topic Starter
  • Member
  • PipPip
  • 10 posts
Me again, just bumping this thread since no-one's replied yet. Kinda need this today so I could use a little help here, please.
  • 0

#3
Moon_Dew

Moon_Dew

    Member

  • Topic Starter
  • Member
  • PipPip
  • 10 posts
Okay, I got an extension on this project's due date, what I don't have is any help, so bumping this thread.
  • 0






Similar Topics

1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users

As Featured On:

Microsoft Yahoo BBC MSN PC Magazine Washington Post HP