TALK @ PhilMusic.com - The Online Home of the Pinoy Musician

Tech Forums => ph.Cyberview => Topic started by: jigaman on April 12, 2011, 10:19:52 AM

Title: Visual Basic Thread *merged*
Post by: jigaman on April 12, 2011, 10:19:52 AM
we're having a thesis right now.
and Im having trouble with vb.net application.
pa help naman po. anyone??  :?
Title: Re: Help sa VB.NET..
Post by: jcbska on April 29, 2011, 02:04:54 PM
what kind of problem bro? pls specify..
Title: Re: Help sa VB.NET..
Post by: jigaman on April 29, 2011, 09:15:18 PM
im having a hard time using a radiobutton for the scoring of my quiz project.
Title: Re: Help sa VB.NET..
Post by: ierofan on May 01, 2011, 08:20:42 AM
Radio button for scoring? Please tell us more.
Title: Re: Help sa VB.NET..
Post by: robertshanepascual on May 01, 2011, 02:25:29 PM
we're having a thesis right now.
and Im having trouble with vb.net application.
pa help naman po. anyone??  :?

print screen naman nun form nung vb na ginagawa mo sir para may idea kami sa gnagawa mo
Title: Visual Basic Thread *merged*
Post by: robertshanepascual on September 10, 2012, 04:22:19 PM
Anyone na malupit mag VB?
sana matulungan nyo ako mga ka PM...

Goal:

* Connect The VB to MS Excel as its Database - Status: working okay na.
* Be able to search the products Serial No to display its Product Information.
 - hindi pa okay  :-( - my problem


Here's the GUI Screen Shot:

(http://i1221.photobucket.com/albums/dd466/robertshanepascual/sampleimage.jpg)

// wag nyo muna po pansinin yung edit/update Button.
Heres the sample attached data * to be saves as " sampledata.xls " in drive c: (as i stated in the source code)


Serial_No   Product Name   Product Code   Date Purchased   Reseller   Warranty   Details
01a   Dell Vostro Laptop   Dell-00121   Sept 29,2012   Octagon   2years   Sample Data Only
02a   MacBook Pro   MBP-1111   Sept 29,2012   TCA   1Year   Sample Data Only
03a   HP Spactre Pro    HP1-01   Sept 29,2012   Villman   3Years   Sample Data Only


and here is the source code (to be pasted in the Search Button)


Imports System.Data.SqlClient

Public Class Form1

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

        Dim MyConnection As System.Data.OleDb.OleDbConnection

        Dim DtSet As System.Data.DataSet

        Dim MyCommand As System.Data.OleDb.OleDbDataAdapter

        MyConnection = New System.Data.OleDb.OleDbConnection("provider=Microsoft.Jet.OLEDB.4.0;Data Source='c:\sampledata.xls';Extended Properties=Excel 8.0;")

        MyCommand = New System.Data.OleDb.OleDbDataAdapter("select * from [Sheet1$]", MyConnection)

        'MyCommand.TableMappings.Add("Table", "Net-informations.com")

        DtSet = New System.Data.DataSet

        MyCommand.Fill(DtSet)

        DataGridView1.DataSource = DtSet.Tables(0)

        MyConnection.Close()

    End Sub

End Class



---
Sana may makatulong :(
TIA

Title: Re: Need Help in Visual Basic 2008. Sana may makatulong :(
Post by: ierofan on September 10, 2012, 08:01:32 PM
Search lang?
Title: Re: Need Help in Visual Basic 2008. Sana may makatulong :(
Post by: thuzkee02 on September 10, 2012, 08:55:47 PM
Wow. babantayan ko to... :)
Title: Re: Need Help in Visual Basic 2008. Sana may makatulong :(
Post by: robertshanepascual on September 11, 2012, 08:47:21 AM
UPDATE:

Gumagana na yung search button and here's the code:
// yung naka highlight yung dinagdag ko na code.
( Bali ang naging concern ko nun una ay baka hindi nababasa ni VB na Field name yung unang column kasi nga Excel file yung ginawa kong database, first time ko din kasi tong ginawa)


Imports System.Data.SqlClient

Public Class Form1

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim MyConnection As System.Data.OleDb.OleDbConnection

        Dim DtSet As System.Data.DataSet

        Dim MyCommand As System.Data.OleDb.OleDbDataAdapter
        Dim source1 As New BindingSource()

        MyConnection = New System.Data.OleDb.OleDbConnection("provider=Microsoft.Jet.OLEDB.4.0;Data Source='d:\sampledata.xls';Extended Properties=Excel 8.0;")

        MyCommand = New System.Data.OleDb.OleDbDataAdapter("select * from [Sheet1$]", MyConnection)

        'MyCommand.TableMappings.Add("Table", "Net-informations.com")


        DtSet = New System.Data.DataSet

        MyCommand.Fill(DtSet)

        DataGridView1.DataSource = DtSet.Tables(0)

        '     Dim view1 As New DataView(tables(0))

        source1.DataSource = DataGridView1.DataSource
        DataGridView1.DataSource = source1
        source1.Filter = "Serial_No = '" & TextBox1.Text & "'"


        MyConnection.Close()



    End Sub

---

OUTPUT:

(http://i1221.photobucket.com/albums/dd466/robertshanepascual/update1.jpg)


* Ang Goal ko naman ngayon is Mapagana yung Update Button.
kapag pinindot yung update button kailangan lalabas yung spreadsheet para
makapag lagay ng bagong data dun sa spreadsheet.

* Tsaka kailangan ko ma Convert to as Asp.Net kasi web based ito iaaply.

 - Any suggestions/ Help Please? :D
Title: Re: Need Help in Visual Basic 2008. Sana may makatulong :(
Post by: ierofan on September 11, 2012, 11:30:51 AM
Kung ipo-port mo ng ASP.net yan, dapat dinirecho mo na. Kasi the two are completely different, I tell you. Kung anong ginagawa mo ngayon jan sa VB, soooobrang kaiba sa ASP.net.
Title: Re: Need Help in Visual Basic 2008. Sana may makatulong :(
Post by: robertshanepascual on September 12, 2012, 12:06:56 PM
@ ierofan, nagawa ko na sya using asp.net gumamit ako ng same coding sa vb pero hindi naman sila nagkakalayo ng syntax.

eto yung code nung sa Search Button Part:


Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
        Label1.Text = ""
        Dim MyConnection As System.Data.OleDb.OleDbConnection

        Dim DtSet As System.Data.DataSet

        Dim MyCommand As System.Data.OleDb.OleDbDataAdapter

        'Dim source1 As New LinqDataSource

        MyConnection = New System.Data.OleDb.OleDbConnection("provider=Microsoft.Jet.OLEDB.4.0;Data Source='d:\sampledata.xls';Extended Properties=Excel 8.0;")

        If TextBox1.Text <> "" Then

            MyCommand = New System.Data.OleDb.OleDbDataAdapter("SELECT [Serial_No], [Product Code], [Product Name], [Date Purchased], [Reseller], [Warranty], [Details] FROM [Sheet1$] WHERE [Serial_No] = '" & TextBox1.Text & "'", MyConnection)

            DtSet = New System.Data.DataSet

            MyCommand.Fill(DtSet)

            GridView1.DataSource = DtSet.Tables(0).DefaultView
            GridView1.DataBind()
            If (GridView1.Rows.Count = 0) Then
                Label1.Text = "No records found"
            End If
            MyConnection.Close()
        Else
            Label1.Text = "Please enter Serial No!"
            TextBox1.Focus()
        End If
    End Sub


---
eto yung output:

(http://i1221.photobucket.com/albums/dd466/robertshanepascual/searchasptype.jpg)

---

Editing/Updating Excel file in Asp nalang ang kulang  :)
Title: share your VB.NET Tips please...
Post by: glennaui on October 15, 2012, 05:07:43 PM
Anyone here who develops VB.NET Apps?
Im currently teaching myself to be familiar with this language
Right now im familiarizing some techniques and I am stuck at this dilemma.

Can anyone help me or suggest some tips? I am looking through the net but somehow I cant manage to find any tips so Im hoping that anyone here can help me...


My dilemmas are these, I want to have a text in the text box saying instructions to the user.
The other is I want to disable the two operating buttons which are ADD and SUBTRACT if there is no data input.

Like this
NOTE: I just edited this pic but this is how my app should be
(http://i815.photobucket.com/albums/zz72/glennaui/1-2.jpg)


Then, when a data has been inserted, the text will be what the user had entered on the textbox and the
two operating buttons shall be enabled...


(http://i815.photobucket.com/albums/zz72/glennaui/2.jpg)

Any tips would help... :wave:
 
Title: Re: share your VB.NET Tips please...
Post by: Riff_6603 on October 16, 2012, 02:56:54 AM
I want to have a text in the text box saying instructions to the user.

For displaying a text in a TextBox control:

TextBox1.Text = "insert instructions here"

You can also collect the input value from a TextBox control to a variable like this way

  Dim var As String

var = TextBox1.Text

The other is I want to disable the two operating buttons which are ADD and SUBTRACT if there is no data input.

pwede ka mag-if then statements na dyan:

If textbox1.text and textbox2.text = "insert command here" then add button and subtract button = "false"

said statement may not work but the concept is similar. nuance kasi yung program na ginagamit ko sa office (variation of VB pero for voice commands naman yung scripting).


you could check out more stuff here:
http://vb.net-informations.com/
Title: Re: share your VB.NET Tips please...
Post by: glennaui on October 16, 2012, 06:31:55 AM
For displaying a text in a TextBox control:

TextBox1.Text = "insert instructions here"

You can also collect the input value from a TextBox control to a variable like this way

  Dim var As String

var = TextBox1.Text

pwede ka mag-if then statements na dyan:

If textbox1.text and textbox2.text = "insert command here" then add button and subtract button = "false"

said statement may not work but the concept is similar. nuance kasi yung program na ginagamit ko sa office (variation of VB pero for voice commands naman yung scripting).


you could check out more stuff here:
http://vb.net-informations.com/

thanks sir. I will try that... :)
Title: Re: share your VB.NET Tips please...
Post by: ierofan on October 16, 2012, 02:02:34 PM
Public Sub Textbox1.onClick() or Public Sub Textbox1.onfocus() something like that. Yun yung pwede mong gamitin.

Kasi yung initialization mo ng textbox is Textbox1.text = "Text here". Sabay yung nasa loob ng Sub Textbox1.text = "" para mabubura sya kapag naclick yung textbox, or nafocus. pwede rin dun mo ilagay yung pag enable/disable ng buttons or other objects.
Title: Re: share your VB.NET Tips please...
Post by: glennaui on October 17, 2012, 06:08:53 AM
Public Sub Textbox1.onClick() or Public Sub Textbox1.onfocus() something like that. Yun yung pwede mong gamitin.

Kasi yung initialization mo ng textbox is Textbox1.text = "Text here". Sabay yung nasa loob ng Sub Textbox1.text = "" para mabubura sya kapag naclick yung textbox, or nafocus. pwede rin dun mo ilagay yung pag enable/disable ng buttons or other objects.

thanks sir... this would be better for my practice...
Title: Re: Visual Basic Thread *merged*
Post by: Riff_6603 on October 21, 2012, 12:28:19 PM
Guys, any ideas kung panong command para ma-recognize ang isang running program then i-minimize niya yun? hindi siya recognized as an application sa task manager, though recognized siya as .exe sa processes tab. worst case scenario ko is to use a batch file instead then idikit ko na lang sa VB command ko. :cry:
Title: Re: Visual Basic Thread *merged*
Post by: ierofan on October 21, 2012, 03:37:55 PM
Guys, any ideas kung panong command para ma-recognize ang isang running program then i-minimize niya yun? hindi siya recognized as an application sa task manager, though recognized siya as .exe sa processes tab. worst case scenario ko is to use a batch file instead then idikit ko na lang sa VB command ko. :cry:

Sir Riff, yung mapupunta ba sa system tray?
Title: Re: Visual Basic Thread *merged*
Post by: Riff_6603 on October 22, 2012, 08:22:41 AM
Sir Riff, yung mapupunta ba sa system tray?

Is there a better way? here's the whole scenario pala: may program ako na patatakbuhin na naka sendkeys yung command. problem with sendkeys, maliban sa program na pinapatakbo ko, tumatalon siya dun sa exe na yun unless naka-minimize siya. tendency, yung command intended only for the program, sa exe napupunta. yung exe na gusto ko i-minimize could only stay minimized for a maximum of 12 minutes tapos balik ulit. kung may command na pwede niya ma-recognize yung window ng exe tapos i-minimize niya, maigi yun. ako na bahalang maglagay nun sa loob ng existing command ko. unfortunately, ayaw gumana ng command na specific window lang dapat mag-run yung specified command, medyo bago pa kasi yung program kaya di pa ganun kaayos. :-(

by the way, via keystrokes na action ba yung naisip mo papuntang system tray? or pwedeng naka-false para hidden yung action? thanks!
Title: Re: Visual Basic Thread *merged*
Post by: glennaui on October 22, 2012, 08:38:55 AM
Im looking for a book(Hard Copied) that can help me build VB.net programming skills... any suggestions?
Title: Re: Visual Basic Thread *merged*
Post by: robertshanepascual on October 25, 2012, 09:22:24 AM
Im looking for a book(Hard Copied) that can help me build VB.net programming skills... any suggestions?

maraming ebooks available sa net tapos sa NBS at sa recto may nakita akong hardcopy.
Title: Re: Visual Basic Thread *merged*
Post by: ierofan on October 25, 2012, 07:59:29 PM
Is there a better way? here's the whole scenario pala: may program ako na patatakbuhin na naka sendkeys yung command. problem with sendkeys, maliban sa program na pinapatakbo ko, tumatalon siya dun sa exe na yun unless naka-minimize siya. tendency, yung command intended only for the program, sa exe napupunta. yung exe na gusto ko i-minimize could only stay minimized for a maximum of 12 minutes tapos balik ulit. kung may command na pwede niya ma-recognize yung window ng exe tapos i-minimize niya, maigi yun. ako na bahalang maglagay nun sa loob ng existing command ko. unfortunately, ayaw gumana ng command na specific window lang dapat mag-run yung specified command, medyo bago pa kasi yung program kaya di pa ganun kaayos. :-(

by the way, via keystrokes na action ba yung naisip mo papuntang system tray? or pwedeng naka-false para hidden yung action? thanks!

If you're familiar with the DoTA hotkeys, (cat hotkey, mineskeys) Yung mga ganun, ganun ba gusto mong achieve? Yung nakukuha yung mga napipindot na keys kahit na nakaminimize sya? May handout ako about sa paglagay sa system tray e, hanapin ko para sayo boss, malakas ka sakin e. hehe. Nakalimutan ko na kasi, tagal ko na di nagvvb e.
Title: Re: Visual Basic Thread *merged*
Post by: Riff_6603 on October 28, 2012, 12:40:06 PM
If you're familiar with the DoTA hotkeys, (cat hotkey, mineskeys) Yung mga ganun, ganun ba gusto mong achieve? Yung nakukuha yung mga napipindot na keys kahit na nakaminimize sya? May handout ako about sa paglagay sa system tray e, hanapin ko para sayo boss, malakas ka sakin e. hehe. Nakalimutan ko na kasi, tagal ko na di nagvvb e.

YES. on top of that, need ko din malaman kung paano command na mag-minimize ng external exe file. yung exe na ito hindi siya lumalabas sa applications tab ng task manager, lumalabas naman siya sa may processes tab though. sorry sa hassle kapatid! :lol:
Title: Re: Visual Basic Thread *merged*
Post by: ierofan on October 29, 2012, 11:17:12 AM
YES. on top of that, need ko din malaman kung paano command na mag-minimize ng external exe file. yung exe na ito hindi siya lumalabas sa applications tab ng task manager, lumalabas naman siya sa may processes tab though. sorry sa hassle kapatid! :lol:

Bossing, wala na. Di ko na makita. Tagal na panahon na kasi nun. May naitapon raw na mga papeles yung nanay ko na galing sa aparador ko e. Baka yun na yun. Sayang naman. Good luck nalang from me bossing.
Title: Re: Visual Basic Thread *merged*
Post by: Riff_6603 on October 31, 2012, 02:01:19 AM
Bossing, wala na. Di ko na makita. Tagal na panahon na kasi nun. May naitapon raw na mga papeles yung nanay ko na galing sa aparador ko e. Baka yun na yun. Sayang naman. Good luck nalang from me bossing.

oks lang bro! been talking to the indian dev guys at the office, apparently they still can't find a way to fix my problem. guess it's more complicated than I thought.. :-P
Title: Re: Visual Basic Thread *merged*
Post by: electronictokwa on November 14, 2012, 10:37:36 PM
Ampft meron pala nitong thread! Baka puede magpatulong mga sirs kung merong malupit dito sa VBA.
Title: Re: Visual Basic Thread *merged*
Post by: robertshanepascual on November 15, 2012, 08:43:29 AM
Ampft meron pala nitong thread! Baka puede magpatulong mga sirs kung merong malupit dito sa VBA.

oras na para magtulungan tayo, wahahahaha! un din kasi ginagawa ko ngayon  :idea:
Title: Re: Visual Basic Thread *merged*
Post by: electronictokwa on November 19, 2012, 10:32:01 PM
oras na para magtulungan tayo, wahahahaha! un din kasi ginagawa ko ngayon  :idea:

Sakto hehe! May ginagawa kasi ako ngaung template sa Excel with saving functionality sa separate sheet (next empty row). Problema ko, merong range sa source na kelangan din copy sa kabilang sheet. Eto ung code ko so far, di pa kasama ung range na dapat ma copy din:

Private Sub CommandButton3_Click() 'save to local database
If Range("B1:B7").Text = "" Then
    MsgBox "No data to save.", vbInformation, "Call Log Form"
Else
Sheets("Database").Activate
Application.ScreenUpdating = False
Dim sh As Worksheet
Dim LR As Long
   
    LR = Sheets("Database").Range("B" & Rows.Count).End(xlUp).Row + 1
    If LR < 6 Then LR = 6
    Sheets("BTO Template").Range("b1:b7").Copy
    Sheets("Database").Range("B" & LR).PasteSpecial xlPasteValues, xlPasteSpecialOperationNone, False, True
    Sheets("BTO Template").Range("A10").Copy
    Sheets("Database").Range("I" & LR).PasteSpecial xlPasteValues, xlPasteSpecialOperationNone, False, True
    Sheets("BTO Template").Range("A19").Copy
    Sheets("Database").Range("J" & LR).PasteSpecial xlPasteValues, xlPasteSpecialOperationNone, False, True
    Sheets("BTO Template").Range("B29").Copy
    Sheets("Database").Range("K" & LR).PasteSpecial xlPasteValues, xlPasteSpecialOperationNone, False, True
    Application.CutCopyMode = False
    Application.ScreenUpdating = True
End If
End Sub

Any thoughts sirs?

Title: Re: Visual Basic Thread *merged*
Post by: robertshanepascual on November 20, 2012, 08:59:16 AM
Sakto hehe! May ginagawa kasi ako ngaung template sa Excel with saving functionality sa separate sheet (next empty row). Problema ko, merong range sa source na kelangan din copy sa kabilang sheet. Eto ung code ko so far, di pa kasama ung range na dapat ma copy din:

Private Sub CommandButton3_Click() 'save to local database
If Range("B1:B7").Text = "" Then
    MsgBox "No data to save.", vbInformation, "Call Log Form"
Else
Sheets("Database").Activate
Application.ScreenUpdating = False
Dim sh As Worksheet
Dim LR As Long
   
    LR = Sheets("Database").Range("B" & Rows.Count).End(xlUp).Row + 1
    If LR < 6 Then LR = 6
    Sheets("BTO Template").Range("b1:b7").Copy
    Sheets("Database").Range("B" & LR).PasteSpecial xlPasteValues, xlPasteSpecialOperationNone, False, True
    Sheets("BTO Template").Range("A10").Copy
    Sheets("Database").Range("I" & LR).PasteSpecial xlPasteValues, xlPasteSpecialOperationNone, False, True
    Sheets("BTO Template").Range("A19").Copy
    Sheets("Database").Range("J" & LR).PasteSpecial xlPasteValues, xlPasteSpecialOperationNone, False, True
    Sheets("BTO Template").Range("B29").Copy
    Sheets("Database").Range("K" & LR).PasteSpecial xlPasteValues, xlPasteSpecialOperationNone, False, True
    Application.CutCopyMode = False
    Application.ScreenUpdating = True
End If
End Sub

Any thoughts sirs?

yung parang V Lookup ba sa excel yung gamit nito? yung mailalagay mo sa kabilang sheet yung ibang info sa kabilang sheet?
Title: Re: Visual Basic Thread *merged*
Post by: electronictokwa on November 21, 2012, 10:16:29 PM
yung parang V Lookup ba sa excel yung gamit nito? yung mailalagay mo sa kabilang sheet yung ibang info sa kabilang sheet?

Yep. Naka save yan to the next empty row galing sa first sheet. ang problema ko, meron kasing range sa template na kelangan i-copy din sa kabila along with the "parent" details., ang nangyayari, nagsasave parin sa next empty row, dapat ma detect muna ng next save yung last row na sakop nung copied range bago sya mag append sa next empty row.
Title: Re: Visual Basic Thread *merged*
Post by: electronictokwa on November 22, 2012, 12:56:42 AM
yung parang V Lookup ba sa excel yung gamit nito? yung mailalagay mo sa kabilang sheet yung ibang info sa kabilang sheet?

Hindi VLOOKUP, straight copy paste lang talaga.
Title: Re: Visual Basic Thread *merged*
Post by: Riff_6603 on February 13, 2013, 05:40:54 AM
guys, baka meron sa inyo marunong mag-integrate ng JS sa VB scripting. care to share some tips?
Title: Re: Visual Basic Thread *merged*
Post by: tonwins11 on April 26, 2013, 08:49:01 AM
Guys, pa help na din.

I'm no comsci nor graduated any computer course. I'm just an enthusiast. Merong ginawa in .frm file format yung kaibigan ko. Nag design siya ng additional tool for MS word. Parang mas integrated "search/find" na tool. Here's my issue, when running the MS word 2007, alt + F11 ako. Then import files which are the .frm na ginawa ng kaibigan ko. Tapos pag na import na, mag re record na ng macro sa word. After recording, view the macro, then edit, dun sa edit, anong code yung dapat i-type para makapa run ko yung form ko? Nakalimutan ko kasi.  :eek: Di ko na rin ma contact yung kaibigan ko. Is there something like "Run (file name).frm"