<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
  <channel>
    <title>Visual Basic Forum RSS Feed (Replies Included)</title>
    <link>http://www.programmersheaven.com/</link>
    <description>Contains the latest posts from the 'Visual Basic' forum at Programmer's Heaven, including replies.</description>
    <language>en</language>
    <copyright>Copyright 2009 Programmers Heaven</copyright>
    <pubDate>Fri, 20 Nov 2009 20:50:57 -0700</pubDate>
    <lastBuildDate>Fri, 20 Nov 2009 20:50:57 -0700</lastBuildDate>
    <generator>Argotic Syndication Framework 2007.3.0.1, http://www.codeplex.com/Argotic</generator>
    <docs>http://www.rssboard.org/rss-specification</docs>
    <ttl>360</ttl>
    <image>
      <url>http://www.programmersheaven.com/images/ph.gif</url>
      <title>Programmers Heaven</title>
      <link>http://www.programmersheaven.com/</link>
      <width>88</width>
      <height>31</height>
    </image>
    <item>
      <title>cheap chanel bags</title>
      <link>http://www.programmersheaven.com/mb/VBasic/409672/409672/cheap-chanel-bags/</link>
      <description>Newest design:shoes,handbags,wallets,sunglasses,clothes,j
eans!&lt;br /&gt;
Free shipping! Speedy delivery!Lowest price!&lt;br /&gt;
high quality!fashion design!best service!&lt;br /&gt;
www.welljordan.com&lt;br /&gt;
&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/VBasic/409672/409672/cheap-chanel-bags/</guid>
      <pubDate>Fri, 20 Nov 2009 20:40:13 -0700</pubDate>
      <category>Visual Basic</category>
    </item>
    <item>
      <title>Re: multiplication table in visual basic</title>
      <link>http://www.programmersheaven.com/mb/VBasic/402600/409619/re-multiplication-table-in-visual-basic/#409619</link>
      <description>Please check this&lt;br /&gt;
&lt;a href="http://www.programmersheaven.com/download/44186/download.aspx"&gt;http://www.programmersheaven.com/download/44186/download.aspx&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
thanks&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/VBasic/402600/409619/re-multiplication-table-in-visual-basic/#409619</guid>
      <pubDate>Thu, 19 Nov 2009 23:20:17 -0700</pubDate>
      <category>Visual Basic</category>
    </item>
    <item>
      <title>Fake Passports for Sale</title>
      <link>http://www.programmersheaven.com/mb/VBasic/400834/409577/fake-passports-for-sale/#409577</link>
      <description>Fake Passports for Sale&lt;br /&gt;
&lt;br /&gt;
If you want to buy high quality fake forged fraudulent counterfeit duplicate false camouflage diplomatic passports and other identification documents of Australia, Austria, Belgium, Canada, Finland, France, Germany, Israel, Malaysia, Netherlands, New Zealand, South Africa, Switzerland, United Kingdom, United States and some other countries please visit this website:&lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://www.FakePassport.Ws"&gt;http://www.FakePassport.Ws&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
E-mail: FakePassports@Gmail.Com&lt;br /&gt;
&lt;br /&gt;
Diplomatic passports are also available on demand&lt;br /&gt;
&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/VBasic/400834/409577/fake-passports-for-sale/#409577</guid>
      <pubDate>Thu, 19 Nov 2009 02:40:38 -0700</pubDate>
      <category>Visual Basic</category>
    </item>
    <item>
      <title>Fake Passports for Sale</title>
      <link>http://www.programmersheaven.com/mb/VBasic/396587/409576/fake-passports-for-sale/#409576</link>
      <description>Fake Passports for Sale&lt;br /&gt;
&lt;br /&gt;
If you want to buy high quality fake forged fraudulent counterfeit duplicate false camouflage diplomatic passports and other identification documents of Australia, Austria, Belgium, Canada, Finland, France, Germany, Israel, Malaysia, Netherlands, New Zealand, South Africa, Switzerland, United Kingdom, United States and some other countries please visit this website:&lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://www.FakePassport.Ws"&gt;http://www.FakePassport.Ws&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
E-mail: FakePassports@Gmail.Com&lt;br /&gt;
&lt;br /&gt;
Diplomatic passports are also available on demand&lt;br /&gt;
&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/VBasic/396587/409576/fake-passports-for-sale/#409576</guid>
      <pubDate>Thu, 19 Nov 2009 02:37:33 -0700</pubDate>
      <category>Visual Basic</category>
    </item>
    <item>
      <title>Re: Access Database recovery</title>
      <link>http://www.programmersheaven.com/mb/VBasic/203064/409436/re-access-database-recovery/#409436</link>
      <description>If you are not able to open your access database than try to repair your database using inbuilt repair utility. Even after that you are not able to repair your database than you need the third party &lt;a href="http://www.repair-access-file.com"&gt;access repair&lt;/a&gt; utility.&lt;br /&gt;
&lt;br /&gt;
David Poul&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/VBasic/203064/409436/re-access-database-recovery/#409436</guid>
      <pubDate>Tue, 17 Nov 2009 04:08:24 -0700</pubDate>
      <category>Visual Basic</category>
    </item>
    <item>
      <title>vb6 Realtime MSChart</title>
      <link>http://www.programmersheaven.com/mb/VBasic/409260/409260/vb6-realtime-mschart/</link>
      <description>I am creating a display to show the PLC values coming in from (KepWare 4) Server. My problem is not really displaying data on the MSChart, but having the MSChart update every second (i.e the rows being the time and the columns being the Conductivity - gallons per minute)&lt;br /&gt;
&lt;br /&gt;
I do not know how to go about this...as every example I've seen so far just shows how to add data to MSChart. I am looking to have the chart always update, going from left to right, as the time progresses.&lt;br /&gt;
&lt;pre class="sourcecode"&gt;Option Explicit
Option Base 1
'Define the server Object
Dim WithEvents ConnectedOPCServer As OPCServer

Public gblConductivity As Integer
'Define the group objects
Dim ConnectedServerGroups As OPCGroups
Dim WithEvents ConnectedGroup As OPCGroup
' Define OPC Item related data. These arrays are dimensioned for seven items.
' If you are doing a different number of items you would change the size.
Dim OPCItemCollection As OPCItems
Dim ItemCount As Long
Dim OPCItemIDs(7) As String
Dim ItemServerHandles() As Long
Dim ItemServerErrors() As Long
Dim ClientHandles(7) As Long
' Define the Data Objects
Dim gDB As ADODB.Connection
Dim gRS_Log As ADODB.Recordset
' Define form and logging control parameters
Dim gLogData As Boolean
'Data Logging trigger
Dim LogDataArray(5) As Single
'Value arrayfor data that will be logged.
Public GintGraphGridSize As Integer

Public dtmCheckTime As Date, dtmCheckDate As Date

' General startup initialization Private
Sub Form_Load()

Call loadOPCdata 'PLC stuff
Call GLoadAccessDB 'Acess Database
Call SetGraphProperties(frmADL) 'My Graph

End Sub

Sub ConnectedGroup_DataChange(ByVal TransactionID As Long, ByVal NumItems As Long, ClientHandles() As Long, ItemValues() As Variant, Qualities() As Long, TimeStamps() As Date)

' We don't have error handling here since this is an event called from the OPC interface
' You can use the 'Clienthandles' array returned by the server to pull out the
' index number of the control to update and load the value. Since we only have
' one we do not worry about that. If you were doing more then one item you might
' use the following code:
'
Dim x As Integer

gLogData = True


For x = 1 To NumItems
Select Case ClientHandles(x)
Case 1 To 5

' Load data to be logged to holding array
LogDataArray(ClientHandles(x)) = ItemValues(x)

' Update the screen display with the data value
myText(ClientHandles(x)).Text = ItemValues(x)

'''''''''''''''''''''''''''''''''''''''''''
'needs to do chart function here I think....

''''''''''''''''''''''''''''''''''''''''''''

Case 6
' Evaluate the Data Logging trigger and set the timer trigger accordingly.
'gLogData = True
If ItemValues(x) = 1 Then
gLogData = True

End If
Case 7 ' Evaluate the Communications Status and set accordingly
If ItemValues(x) = True Then
indError.Visible = True
Else
indError.Visible = False
End If
End Select
Next x
End Sub

Private Sub tmrLogData_Timer()

Dim x As Integer
Dim timevalues(5) As String

MSChartConductivity.Row = 1
timevalues(1) = Format(DateAdd("s", x, dtmCheckTime))
MSChartConductivity.RowLabel = dtmCheckTime
MSChartConductivity.Data = myText(1).Text

For x = 1 To 5


txtTimeConductivity.Text = Now()


MSChartConductivity.Row = x
timevalues(1) = Format(DateAdd("s", x - 4, dtmCheckTime))
MSChartConductivity.RowLabel = dtmCheckTime
MSChartConductivity.Data = myText(1).Text

Call writeToDatabase
Next x

End Sub

Private Sub SetGraphProperties(ByRef frmADL As Form)
On Error GoTo ErrHandle

MSChartConductivity.Column = 1


With MSChartConductivity.Plot.SeriesCollection(1)
.Pen.VtColor.Set 250, 1, 10
.Pen.Width = 1
.LegendText = "Conductivity"
End With

Exit Sub
ErrHandle:

End Sub

Private Sub writeToDatabase()

dtmCheckTime = Format(Now, "hh:mm:ss AMPM")
dtmCheckDate = Format(Now, "dd mmm yyyy")

If gLogData Then
With gRS_Log
.MoveLast
.AddNew
![tagDataValue1] = LogDataArray(1)
![tagDataValue2] = 0 'LogDataArray(2)
![tagDataValue3] = 0 'LogDataArray(3)
![tagDataValue4] = 0 'LogDataArray(4)
![tagTime] = dtmCheckTime
![tagDate] = dtmCheckDate

.Update

End With
gLogData = False

txtRECS.Text = gRS_Log.RecordCount
End If
End Sub


Public Sub loadOPCdata()
'Create a new OPC Server object
Set ConnectedOPCServer = New OPCServer
ConnectedOPCServer.Connect "Kepware.KepserverEx.V4"

' Add the group and set its update rate
Set ConnectedServerGroups = ConnectedOPCServer.OPCGroups
Set ConnectedGroup = ConnectedServerGroups.Add("TRACKER")

' Set the update rate for the group
ConnectedGroup.UpdateRate = 150

' Subscribe the group so that you will be able to get the data change
' callbacks from the server
ConnectedGroup.IsSubscribed = True

'Next we will add 7 items. If your were going to add more then 7 item then you would need to
'make sure that you increase the OPCItemIDs and Client Handles Arrays to the number of items
'you will be adding. You will also need to increase the item count to correspond to the
'number of items that you are adding.
ItemCount = 7

' Add initialize the 5 items to be logged
OPCItemIDs(1) = "Channel1.TRACKER.Tag_1"
ClientHandles(1) = 1
OPCItemIDs(2) = "Channel1.TRACKER.Tag_1"
ClientHandles(2) = 2
OPCItemIDs(3) = "Channel1.TRACKER.Tag_2"
ClientHandles(3) = 3
OPCItemIDs(4) = "Channel1.TRACKER.Tag_2"
ClientHandles(4) = 4
OPCItemIDs(5) = "Channel1.TRACKER.Tag_3"
ClientHandles(5) = 5
OPCItemIDs(6) = "Channel1.TRACKER.Tag_3"
ClientHandles(6) = 6
OPCItemIDs(7) = "Channel1.TRACKER.Tag_4"
ClientHandles(7) = 7

' Establish a connection to the OPC item interface of the connected group

Set OPCItemCollection = ConnectedGroup.OPCItems
OPCItemCollection.DefaultIsActive = True
OPCItemCollection.AddItems ItemCount, OPCItemIDs, ClientHandles, ItemServerHandles, ItemServerErrors

End Sub

Public Sub GLoadAccessDB()

'Initialize new data objects
Set gDB = New ADODB.Connection
Set gRS_Log = New ADODB.Recordset

'Open Database and Table for Data Logging
gDB.Open "Provider=Microsoft.Jet.OLEDB.4.0;data Source=" &amp;amp; App.Path &amp;amp; "\ADL_Data.mdb"
gRS_Log.Open "tblProdData", gDB, adOpenDynamic, adLockOptimistic

'Initialize Record Count field. Some databases or cursor types will not display a value
'other then -1. For those we will hide the field
If (gRS_Log.RecordCount) = -1 Then
txtRECS.Visible = False
txtRECS.Text = gRS_Log.RecordCount &amp;amp; " Total Records."
Else
txtRECS.Text = gRS_Log.RecordCount &amp;amp; " Total Records."
End If

End Sub&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/VBasic/409260/409260/vb6-realtime-mschart/</guid>
      <pubDate>Fri, 13 Nov 2009 12:24:15 -0700</pubDate>
      <category>Visual Basic</category>
    </item>
    <item>
      <title>Interact VB with water detector</title>
      <link>http://www.programmersheaven.com/mb/VBasic/409224/409224/interact-vb-with-water-detector/</link>
      <description>Dear all,&lt;br /&gt;
&lt;br /&gt;
I am new in harware interface. I'm designing a flood monitoring system and i want to interact the system with VB.Im using the microcontroller and water detector. When the sensor sense water, i would like to show the output on VB.The harware is very simple because im using only one water detector for testing but i didnt know the coding to interact it with VB.could anyone plz help me with the coding plz..&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/VBasic/409224/409224/interact-vb-with-water-detector/</guid>
      <pubDate>Fri, 13 Nov 2009 06:50:52 -0700</pubDate>
      <category>Visual Basic</category>
    </item>
    <item>
      <title>Interact VB with water detector</title>
      <link>http://www.programmersheaven.com/mb/VBasic/409223/409223/interact-vb-with-water-detector/</link>
      <description>Dear all,&lt;br /&gt;
&lt;br /&gt;
I am new in harware interface. I'm designing a flood monitoring system and i want to interact the system with VB.Im using the microcontroller and water detector. When the sensor sense water, i would like to show the output on VB.The harware is very simple because im using only one water detector for testing but i didnt know the coding to interact it with VB.could anyone plz help me with the coding plz..&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/VBasic/409223/409223/interact-vb-with-water-detector/</guid>
      <pubDate>Fri, 13 Nov 2009 06:48:33 -0700</pubDate>
      <category>Visual Basic</category>
    </item>
    <item>
      <title>PLEASE HELP GUYS</title>
      <link>http://www.programmersheaven.com/mb/VBasic/409049/409049/please-help-guys/</link>
      <description>how do i code this in vb2008 using windows forms application&lt;br /&gt;
&lt;br /&gt;
You have been hired to develop a payroll software application for a company.The application should display an employee's pay given the the number of hours an employee worked during the week.The company would also like the application to display the work status of the employee eg. Full Time or Part Time. Full time employees work at least 40 hours a week and part time employees work no more than 20 hours a week. Employees that work more than 40 hours a week receive overtime pay at time and a half. &lt;br /&gt;
&lt;br /&gt;
The application should display the number of hours that the employee worked. The company would also like the application to display the various taxes the employee has to have deducted from the weekly pay. Full time employees pay FICA tax at 10%, social security at 15% and other miscelaneous taxes at 10%. All taxes are calculated against the gross weekly pay which includes overtime pay. Employees that work part  time don't pay any taxes. &lt;br /&gt;
&lt;br /&gt;
Some full time employees contribute to a Tax Deferred Annuity (TDA) account. The employee decides how much to contribute to this account and that amount is deducted from their gross pay before any taxes are calculated and deducted from their pay. Your application should display the amount the employee wants to contribute to the TDA. &lt;br /&gt;
&lt;br /&gt;
You will get the number of hours worked from the user of the application and whether the employee is contributing to the TDA and how much they are contributing.&lt;br /&gt;
&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/VBasic/409049/409049/please-help-guys/</guid>
      <pubDate>Tue, 10 Nov 2009 17:28:26 -0700</pubDate>
      <category>Visual Basic</category>
    </item>
    <item>
      <title>Newbie Question Regarding DirectSound</title>
      <link>http://www.programmersheaven.com/mb/VBasic/409016/409016/newbie-question-regarding-directsound/</link>
      <description>Hi,&lt;br /&gt;
&lt;br /&gt;
I am currently developing a PC game based on the game show &lt;em&gt;Card Sharks&lt;/em&gt;, and I am experiencing a dilemma as of recently.&lt;br /&gt;
&lt;br /&gt;
I am hoping to use more than one DSBuffer (I would use, for example, "SoundClipA.wav", "SoundClipB.wav", and "SoundClipC.wav").&lt;br /&gt;
&lt;br /&gt;
If I were to have separate cases using the DSBuffers mentioned above, like this:&lt;br /&gt;
&lt;pre class="sourcecode"&gt;
    Case PlayIntro
        Dim cur As DSCURSORS
        DSBuffer.GetCurrentPosition cur
        contBkgd(1).Visible = True
        If cur.lPlay &amp;gt; 104861 Then 'bytes
          Label1.Caption = "This is an EDUCATED GUESS question."
          Command1.Enabled = True
        ElseIf cur.lPlay &amp;gt; 82785 Then 'bytes
          If QuesRB(0).Caption = "B" Then
            WhosTurn = BluePlayer
            Label1.Caption = "Blue, this question is for you."
            BBorder(1).Visible = True
            board.Visible = False
          ElseIf QuesRB(0).Caption = "R" Then
            WhosTurn = RedPlayer
            Label1.Caption = "Red, this question is for you."
            RBorder(1).Visible = True
          End If
            Image1(0).Visible = False
            Image1(1).Visible = False
            Image1(2).Visible = False
            Image1(3).Visible = False
            Image1(4).Visible = False
            Image2(0).Visible = False
            Image2(1).Visible = False
            Image2(2).Visible = False
            Image2(3).Visible = False
            Image2(4).Visible = False
    '          Timer1.Enabled = False
        ElseIf cur.lPlay &amp;gt; 75250 Then
          Image2(4).Visible = True
        ElseIf cur.lPlay &amp;gt; 67725 Then
          Image2(3).Visible = True
        ElseIf cur.lPlay &amp;gt; 60200 Then
          Image1(4).Visible = True
        ElseIf cur.lPlay &amp;gt; 52625 Then
          Image2(2).Visible = True
        ElseIf cur.lPlay &amp;gt; 45150 Then
          Image1(3).Visible = True
        ElseIf cur.lPlay &amp;gt; 37625 Then
          Image2(1).Visible = True
        ElseIf cur.lPlay &amp;gt; 30100 Then
          Image1(2).Visible = True
        ElseIf cur.lPlay &amp;gt; 22575 Then
          Image2(0).Visible = True
        ElseIf cur.lPlay &amp;gt; 15050 Then
          Image1(1).Visible = True
        ElseIf cur.lPlay &amp;gt; 7525 Then
          Image1(0).Visible = True
        ElseIf cur.lPlay &amp;gt; 0 Then
          board.Visible = True
        End If&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
And I was to use the "SoundClipB.wav" in another case, like this:&lt;br /&gt;
&lt;pre class="sourcecode"&gt;
    Case PlayIntro2
        Dim cur As DSCURSORS
        DSBuffer.GetCurrentPosition cur
        contBkgd(1).Visible = True
        If cur.lPlay &amp;gt; 104861 Then 'bytes
          Label1.Caption = "We surveyed 100 people..."
          Command1.Enabled = True
        ElseIf cur.lPlay &amp;gt; 82785 Then 'bytes
          If QuesRB(0).Caption = "B" Then
            WhosTurn = BluePlayer
            Label1.Caption = "Blue, this question is for you."
            BBorder(1).Visible = True
            board.Visible = False
          ElseIf QuesRB(0).Caption = "R" Then
            WhosTurn = RedPlayer
            Label1.Caption = "Red, this question is for you."
            RBorder(1).Visible = True
          End If
            Image1(0).Visible = False
            Image1(1).Visible = False
            Image1(2).Visible = False
            Image1(3).Visible = False
            Image1(4).Visible = False
            Image2(0).Visible = False
            Image2(1).Visible = False
            Image2(2).Visible = False
            Image2(3).Visible = False
            Image2(4).Visible = False
    '          Timer1.Enabled = False
        ElseIf cur.lPlay &amp;gt; 75250 Then
          Image2(4).Visible = True
        ElseIf cur.lPlay &amp;gt; 67725 Then
          Image2(3).Visible = True
        ElseIf cur.lPlay &amp;gt; 60200 Then
          Image1(4).Visible = True
        ElseIf cur.lPlay &amp;gt; 52625 Then
          Image2(2).Visible = True
        ElseIf cur.lPlay &amp;gt; 45150 Then
          Image1(3).Visible = True
        ElseIf cur.lPlay &amp;gt; 37625 Then
          Image2(1).Visible = True
        ElseIf cur.lPlay &amp;gt; 30100 Then
          Image1(2).Visible = True
        ElseIf cur.lPlay &amp;gt; 22575 Then
          Image2(0).Visible = True
        ElseIf cur.lPlay &amp;gt; 15050 Then
          Image1(1).Visible = True
        ElseIf cur.lPlay &amp;gt; 7525 Then
          Image1(0).Visible = True
        ElseIf cur.lPlay &amp;gt; 0 Then
          board.Visible = True
        End If&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
...what would I have to do in order to allow those DSBuffers to play in those separate cases?  Would I be required to use Private Subs for those separate DSBuffers?  Would anybody be able to provide a sample code?</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/VBasic/409016/409016/newbie-question-regarding-directsound/</guid>
      <pubDate>Tue, 10 Nov 2009 04:47:55 -0700</pubDate>
      <category>Visual Basic</category>
    </item>
    <item>
      <title>TimeZoneInformation difference in XP and Vista</title>
      <link>http://www.programmersheaven.com/mb/VBasic/408913/408913/timezoneinformation-difference-in-xp-and-vista/</link>
      <description>I have a problem with a difference between XP and Vista in the registry.&lt;br /&gt;
In the registry the information is on:&lt;br /&gt;
"HKEY_LOCAL_MACHINE\System\CurrentControlSet\Contr
ol\TimeZoneInformation"&lt;br /&gt;
&lt;br /&gt;
In XP:&lt;br /&gt;
DaylightName  RGE_SZ  West-Europa (zomertijd)&lt;br /&gt;
...&lt;br /&gt;
StandardName  RGE_SZ  West-Europa (standaardtijd)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In Vista:&lt;br /&gt;
DaylightName  RGE_SZ  @tzres.dll,-281&lt;br /&gt;
...&lt;br /&gt;
StandardName  RGE_SZ  @tzres.dll,-282&lt;br /&gt;
&lt;br /&gt;
Q1: is this a bug in Vista?&lt;br /&gt;
Q2: how must I interpret the tzres.dll information?&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/VBasic/408913/408913/timezoneinformation-difference-in-xp-and-vista/</guid>
      <pubDate>Fri, 06 Nov 2009 03:41:22 -0700</pubDate>
      <category>Visual Basic</category>
    </item>
    <item>
      <title>newbie help</title>
      <link>http://www.programmersheaven.com/mb/VBasic/408787/408787/newbie-help/</link>
      <description>Whenever I click the 'OK' button I get the message "No sales data to summarize."  I tried to write the code so this message would only appear if the count integer was zero or less.  Anyone know what I'm doing wrong?  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'Project:     Yacht Charters&lt;br /&gt;
'Programmer:  Michelle Smith&lt;br /&gt;
'Date:        November 2009&lt;br /&gt;
'Description: Maintain a list of yacht brands and sizes; prints&lt;br /&gt;
'             a summary report of revenue, number of charters&lt;br /&gt;
'             and average hours per charter.&lt;br /&gt;
'Folder:      My Project&lt;br /&gt;
&lt;br /&gt;
Public Class MainForm&lt;br /&gt;
    ' Declare module-level variables.&lt;br /&gt;
    Private TotalRevenueDecimal, AverageHoursDecimal As Decimal&lt;br /&gt;
    Private CharterCountInteger As Integer&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    Private Sub AddYachtTypeToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AddYachtTypeToolStripMenuItem.Click&lt;br /&gt;
        ' Add a new yacht type to the yacht list.&lt;br /&gt;
&lt;br /&gt;
        With YachtTypeComboBox&lt;br /&gt;
            ' Test for blank input.&lt;br /&gt;
            If .Text &amp;lt;&amp;gt; "" Then&lt;br /&gt;
                ' Make sure item is not already on the list.&lt;br /&gt;
                Dim ItemFoundBoolean As Boolean&lt;br /&gt;
                Dim ItemIndexInteger As Integer&lt;br /&gt;
                Do Until ItemFoundBoolean Or ItemIndexInteger = .Items.Count&lt;br /&gt;
                    If .Text = .Items(ItemIndexInteger).ToString() Then&lt;br /&gt;
                        ItemFoundBoolean = True&lt;br /&gt;
                        Exit Do&lt;br /&gt;
                    Else&lt;br /&gt;
                        ItemIndexInteger += 1&lt;br /&gt;
                    End If&lt;br /&gt;
                Loop&lt;br /&gt;
                If ItemFoundBoolean Then&lt;br /&gt;
                    MessageBox.Show("Duplicate item.", "Add Failed", _&lt;br /&gt;
                     MessageBoxButtons.OK, MessageBoxIcon.Exclamation)&lt;br /&gt;
                Else&lt;br /&gt;
                    ' If it's not in the list, add it.&lt;br /&gt;
                    .Items.Add(.Text)&lt;br /&gt;
                    .Text = ""&lt;br /&gt;
                End If&lt;br /&gt;
            Else&lt;br /&gt;
                MessageBox.Show("Enter a yacht type to add", _&lt;br /&gt;
                  "Missing Data", MessageBoxButtons.OK, _&lt;br /&gt;
                MessageBoxIcon.Exclamation)&lt;br /&gt;
            End If&lt;br /&gt;
            .Focus()&lt;br /&gt;
        End With&lt;br /&gt;
    End Sub&lt;br /&gt;
&lt;br /&gt;
    Private Sub ExitToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ExitToolStripMenuItem.Click&lt;br /&gt;
        ' End the program.&lt;br /&gt;
&lt;br /&gt;
        Me.Close()&lt;br /&gt;
    End Sub&lt;br /&gt;
&lt;br /&gt;
    Private Sub ClearForNextCharterToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ClearForNextCharterToolStripMenuItem.Click&lt;br /&gt;
        ' Clear all controls.&lt;br /&gt;
        Dim ResponseDialogResult As DialogResult&lt;br /&gt;
        ResponseDialogResult = MessageBox.Show("Clear the form?", _&lt;br /&gt;
          "Clear all items", MessageBoxButtons.YesNo, MessageBoxIcon.Question)&lt;br /&gt;
        If ResponseDialogResult = DialogResult.Yes Then&lt;br /&gt;
            YachtTypeComboBox.SelectedIndex = -1&lt;br /&gt;
            YachtSizeComboBox.SelectedIndex = -1&lt;br /&gt;
            ResponsiblePartyTextBox.Clear()&lt;br /&gt;
            HoursTextBox.Clear()&lt;br /&gt;
            PriceTextBox.Clear()&lt;br /&gt;
        End If&lt;br /&gt;
    End Sub&lt;br /&gt;
&lt;br /&gt;
    Private Sub ClearButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ClearButton.Click&lt;br /&gt;
        ' Clear all controls.&lt;br /&gt;
        Dim ResponseDialogResult As DialogResult&lt;br /&gt;
        ResponseDialogResult = MessageBox.Show("Clear the form?", _&lt;br /&gt;
          "Clear all items", MessageBoxButtons.YesNo, MessageBoxIcon.Question)&lt;br /&gt;
        If ResponseDialogResult = DialogResult.Yes Then&lt;br /&gt;
            YachtTypeComboBox.SelectedIndex = -1&lt;br /&gt;
            YachtSizeComboBox.SelectedIndex = -1&lt;br /&gt;
            ResponsiblePartyTextBox.Clear()&lt;br /&gt;
            HoursTextBox.Clear()&lt;br /&gt;
            PriceTextBox.Clear()&lt;br /&gt;
        End If&lt;br /&gt;
    End Sub&lt;br /&gt;
&lt;br /&gt;
    Private Sub OkButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OkButton.Click&lt;br /&gt;
        Dim PriceInteger, HoursInteger, TotalHoursInteger As Integer&lt;br /&gt;
&lt;br /&gt;
        Try&lt;br /&gt;
            HoursInteger = Integer.Parse(HoursTextBox.Text)&lt;br /&gt;
&lt;br /&gt;
            With YachtSizeComboBox&lt;br /&gt;
                If .SelectedIndex = 0 Then&lt;br /&gt;
                    PriceInteger = HoursInteger * 95D&lt;br /&gt;
                ElseIf .SelectedIndex = 1 Then&lt;br /&gt;
                    PriceInteger = HoursInteger * 137D&lt;br /&gt;
                ElseIf .SelectedIndex = 2 Then&lt;br /&gt;
                    PriceInteger = HoursInteger * 160D&lt;br /&gt;
                ElseIf .SelectedIndex = 3 Then&lt;br /&gt;
                    PriceInteger = HoursInteger * 192D&lt;br /&gt;
                ElseIf .SelectedIndex = 4 Then&lt;br /&gt;
                    PriceInteger = HoursInteger * 250D&lt;br /&gt;
                ElseIf .SelectedIndex = 5 Then&lt;br /&gt;
                    PriceInteger = HoursInteger * 400D&lt;br /&gt;
                ElseIf .SelectedIndex = 6 Then&lt;br /&gt;
                    PriceInteger = HoursInteger * 550D&lt;br /&gt;
                    If .SelectedIndex &amp;lt;&amp;gt; -1 Then&lt;br /&gt;
                        CharterCountInteger += 1&lt;br /&gt;
                    Else&lt;br /&gt;
                        MessageBox.Show("Enter a yacht size", _&lt;br /&gt;
                          "Missing Data", MessageBoxButtons.OK, _&lt;br /&gt;
                          MessageBoxIcon.Exclamation)&lt;br /&gt;
                    End If&lt;br /&gt;
                End If&lt;br /&gt;
            End With&lt;br /&gt;
            PriceTextBox.Text = PriceInteger.ToString("C")&lt;br /&gt;
&lt;br /&gt;
            If CharterCountInteger &amp;gt; 0 Then&lt;br /&gt;
                ' Calculate the average.&lt;br /&gt;
&lt;br /&gt;
                AverageHoursDecimal = TotalHoursInteger / CharterCountInteger&lt;br /&gt;
            Else&lt;br /&gt;
                MessageBox.Show("No sales data to summarize.", "Average Charter Summary", _&lt;br /&gt;
                                MessageBoxButtons.OK, MessageBoxIcon.Information)&lt;br /&gt;
            End If&lt;br /&gt;
&lt;br /&gt;
            &lt;br /&gt;
&lt;br /&gt;
        Catch QuantityException As FormatException&lt;br /&gt;
            MessageBox.Show("Quantity must be numeric.", "Data entry error", _&lt;br /&gt;
                            MessageBoxButtons.OK, MessageBoxIcon.Information)&lt;br /&gt;
            With HoursTextBox&lt;br /&gt;
                .Focus()&lt;br /&gt;
                .SelectAll()&lt;br /&gt;
            End With&lt;br /&gt;
        End Try&lt;br /&gt;
        TotalRevenueDecimal += PriceInteger&lt;br /&gt;
        TotalHoursInteger += HoursInteger&lt;br /&gt;
        &lt;br /&gt;
    End Sub&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
    Private Sub PrintSummaryPrintDocument_PrintPage(ByVal sender As System.Object, ByVal e As System.Drawing.Printing.PrintPageEventArgs) Handles PrintSummaryPrintDocument.PrintPage&lt;br /&gt;
        ' Handle printing and print preview when printing page.&lt;br /&gt;
        Dim PrintFont As New Font("Arial", 12)&lt;br /&gt;
        Dim HeadingFont As New Font("Arial", 14, FontStyle.Bold)&lt;br /&gt;
        Dim LineHeightSingle As Single = PrintFont.GetHeight + 2&lt;br /&gt;
        Dim HorizontalPrintLocationSingle As Single = e.MarginBounds.Left&lt;br /&gt;
        Dim VerticalPrintLocationSingle As Single = e.MarginBounds.Top&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        ' Set up and display heading lines.&lt;br /&gt;
        e.Graphics.DrawString("Charter Summary", HeadingFont, _&lt;br /&gt;
                              Brushes.Black, HorizontalPrintLocationSingle, VerticalPrintLocationSingle)&lt;br /&gt;
        VerticalPrintLocationSingle += LineHeightSingle&lt;br /&gt;
        e.Graphics.DrawString("by Michelle Smith", HeadingFont, _&lt;br /&gt;
                              Brushes.Black, HorizontalPrintLocationSingle, VerticalPrintLocationSingle)&lt;br /&gt;
        VerticalPrintLocationSingle += LineHeightSingle&lt;br /&gt;
        e.Graphics.DrawString("Total Revenue: " &amp;amp; TotalRevenueDecimal.ToString("C"), PrintFont, _&lt;br /&gt;
                              Brushes.Black, 600, HorizontalPrintLocationSingle)&lt;br /&gt;
&lt;br /&gt;
        VerticalPrintLocationSingle += LineHeightSingle * 2&lt;br /&gt;
        e.Graphics.DrawString("Total Number of Charters: " &amp;amp; CharterCountInteger.ToString(), PrintFont, _&lt;br /&gt;
                              Brushes.Black, 600, HorizontalPrintLocationSingle)&lt;br /&gt;
        VerticalPrintLocationSingle += LineHeightSingle * 2&lt;br /&gt;
        e.Graphics.DrawString("Average Hours Chartered: " &amp;amp; AverageHoursDecimal.ToString("D2"), PrintFont, _&lt;br /&gt;
                              Brushes.Black, 600, HorizontalPrintLocationSingle)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    End Sub&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    Private Sub PrintSummaryToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PrintSummaryToolStripMenuItem.Click&lt;br /&gt;
        ' Assign the PrintSummaryPrintDocument to the preview.&lt;br /&gt;
&lt;br /&gt;
        PrintPreviewDialog1.Document = PrintSummaryPrintDocument&lt;br /&gt;
        ' Show the dialog.&lt;br /&gt;
        PrintPreviewDialog1.ShowDialog()&lt;br /&gt;
    End Sub&lt;br /&gt;
End Class&lt;br /&gt;
&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/VBasic/408787/408787/newbie-help/</guid>
      <pubDate>Tue, 03 Nov 2009 16:43:03 -0700</pubDate>
      <category>Visual Basic</category>
    </item>
    <item>
      <title>newbie help</title>
      <link>http://www.programmersheaven.com/mb/VBasic/408786/408786/newbie-help/</link>
      <description>Whenever I click the 'OK' button I get the message "No sales data to summarize."  I tried to write the code so this message would only appear if the count integer was zero or less.  Anyone know what I'm doing wrong?  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'Project:     Yacht Charters&lt;br /&gt;
'Programmer:  Michelle Smith&lt;br /&gt;
'Date:        November 2009&lt;br /&gt;
'Description: Maintain a list of yacht brands and sizes; prints&lt;br /&gt;
'             a summary report of revenue, number of charters&lt;br /&gt;
'             and average hours per charter.&lt;br /&gt;
'Folder:      My Project&lt;br /&gt;
&lt;br /&gt;
Public Class MainForm&lt;br /&gt;
    ' Declare module-level variables.&lt;br /&gt;
    Private TotalRevenueDecimal, AverageHoursDecimal As Decimal&lt;br /&gt;
    Private CharterCountInteger As Integer&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    Private Sub AddYachtTypeToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AddYachtTypeToolStripMenuItem.Click&lt;br /&gt;
        ' Add a new yacht type to the yacht list.&lt;br /&gt;
&lt;br /&gt;
        With YachtTypeComboBox&lt;br /&gt;
            ' Test for blank input.&lt;br /&gt;
            If .Text &amp;lt;&amp;gt; "" Then&lt;br /&gt;
                ' Make sure item is not already on the list.&lt;br /&gt;
                Dim ItemFoundBoolean As Boolean&lt;br /&gt;
                Dim ItemIndexInteger As Integer&lt;br /&gt;
                Do Until ItemFoundBoolean Or ItemIndexInteger = .Items.Count&lt;br /&gt;
                    If .Text = .Items(ItemIndexInteger).ToString() Then&lt;br /&gt;
                        ItemFoundBoolean = True&lt;br /&gt;
                        Exit Do&lt;br /&gt;
                    Else&lt;br /&gt;
                        ItemIndexInteger += 1&lt;br /&gt;
                    End If&lt;br /&gt;
                Loop&lt;br /&gt;
                If ItemFoundBoolean Then&lt;br /&gt;
                    MessageBox.Show("Duplicate item.", "Add Failed", _&lt;br /&gt;
                     MessageBoxButtons.OK, MessageBoxIcon.Exclamation)&lt;br /&gt;
                Else&lt;br /&gt;
                    ' If it's not in the list, add it.&lt;br /&gt;
                    .Items.Add(.Text)&lt;br /&gt;
                    .Text = ""&lt;br /&gt;
                End If&lt;br /&gt;
            Else&lt;br /&gt;
                MessageBox.Show("Enter a yacht type to add", _&lt;br /&gt;
                  "Missing Data", MessageBoxButtons.OK, _&lt;br /&gt;
                MessageBoxIcon.Exclamation)&lt;br /&gt;
            End If&lt;br /&gt;
            .Focus()&lt;br /&gt;
        End With&lt;br /&gt;
    End Sub&lt;br /&gt;
&lt;br /&gt;
    Private Sub ExitToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ExitToolStripMenuItem.Click&lt;br /&gt;
        ' End the program.&lt;br /&gt;
&lt;br /&gt;
        Me.Close()&lt;br /&gt;
    End Sub&lt;br /&gt;
&lt;br /&gt;
    Private Sub ClearForNextCharterToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ClearForNextCharterToolStripMenuItem.Click&lt;br /&gt;
        ' Clear all controls.&lt;br /&gt;
        Dim ResponseDialogResult As DialogResult&lt;br /&gt;
        ResponseDialogResult = MessageBox.Show("Clear the form?", _&lt;br /&gt;
          "Clear all items", MessageBoxButtons.YesNo, MessageBoxIcon.Question)&lt;br /&gt;
        If ResponseDialogResult = DialogResult.Yes Then&lt;br /&gt;
            YachtTypeComboBox.SelectedIndex = -1&lt;br /&gt;
            YachtSizeComboBox.SelectedIndex = -1&lt;br /&gt;
            ResponsiblePartyTextBox.Clear()&lt;br /&gt;
            HoursTextBox.Clear()&lt;br /&gt;
            PriceTextBox.Clear()&lt;br /&gt;
        End If&lt;br /&gt;
    End Sub&lt;br /&gt;
&lt;br /&gt;
    Private Sub ClearButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ClearButton.Click&lt;br /&gt;
        ' Clear all controls.&lt;br /&gt;
        Dim ResponseDialogResult As DialogResult&lt;br /&gt;
        ResponseDialogResult = MessageBox.Show("Clear the form?", _&lt;br /&gt;
          "Clear all items", MessageBoxButtons.YesNo, MessageBoxIcon.Question)&lt;br /&gt;
        If ResponseDialogResult = DialogResult.Yes Then&lt;br /&gt;
            YachtTypeComboBox.SelectedIndex = -1&lt;br /&gt;
            YachtSizeComboBox.SelectedIndex = -1&lt;br /&gt;
            ResponsiblePartyTextBox.Clear()&lt;br /&gt;
            HoursTextBox.Clear()&lt;br /&gt;
            PriceTextBox.Clear()&lt;br /&gt;
        End If&lt;br /&gt;
    End Sub&lt;br /&gt;
&lt;br /&gt;
    Private Sub OkButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OkButton.Click&lt;br /&gt;
        Dim PriceInteger, HoursInteger, TotalHoursInteger As Integer&lt;br /&gt;
&lt;br /&gt;
        Try&lt;br /&gt;
            HoursInteger = Integer.Parse(HoursTextBox.Text)&lt;br /&gt;
&lt;br /&gt;
            With YachtSizeComboBox&lt;br /&gt;
                If .SelectedIndex = 0 Then&lt;br /&gt;
                    PriceInteger = HoursInteger * 95D&lt;br /&gt;
                ElseIf .SelectedIndex = 1 Then&lt;br /&gt;
                    PriceInteger = HoursInteger * 137D&lt;br /&gt;
                ElseIf .SelectedIndex = 2 Then&lt;br /&gt;
                    PriceInteger = HoursInteger * 160D&lt;br /&gt;
                ElseIf .SelectedIndex = 3 Then&lt;br /&gt;
                    PriceInteger = HoursInteger * 192D&lt;br /&gt;
                ElseIf .SelectedIndex = 4 Then&lt;br /&gt;
                    PriceInteger = HoursInteger * 250D&lt;br /&gt;
                ElseIf .SelectedIndex = 5 Then&lt;br /&gt;
                    PriceInteger = HoursInteger * 400D&lt;br /&gt;
                ElseIf .SelectedIndex = 6 Then&lt;br /&gt;
                    PriceInteger = HoursInteger * 550D&lt;br /&gt;
                    If .SelectedIndex &amp;lt;&amp;gt; -1 Then&lt;br /&gt;
                        CharterCountInteger += 1&lt;br /&gt;
                    Else&lt;br /&gt;
                        MessageBox.Show("Enter a yacht size", _&lt;br /&gt;
                          "Missing Data", MessageBoxButtons.OK, _&lt;br /&gt;
                          MessageBoxIcon.Exclamation)&lt;br /&gt;
                    End If&lt;br /&gt;
                End If&lt;br /&gt;
            End With&lt;br /&gt;
            PriceTextBox.Text = PriceInteger.ToString("C")&lt;br /&gt;
&lt;br /&gt;
            If CharterCountInteger &amp;gt; 0 Then&lt;br /&gt;
                ' Calculate the average.&lt;br /&gt;
&lt;br /&gt;
                AverageHoursDecimal = TotalHoursInteger / CharterCountInteger&lt;br /&gt;
            Else&lt;br /&gt;
                MessageBox.Show("No sales data to summarize.", "Average Charter Summary", _&lt;br /&gt;
                                MessageBoxButtons.OK, MessageBoxIcon.Information)&lt;br /&gt;
            End If&lt;br /&gt;
&lt;br /&gt;
            &lt;br /&gt;
&lt;br /&gt;
        Catch QuantityException As FormatException&lt;br /&gt;
            MessageBox.Show("Quantity must be numeric.", "Data entry error", _&lt;br /&gt;
                            MessageBoxButtons.OK, MessageBoxIcon.Information)&lt;br /&gt;
            With HoursTextBox&lt;br /&gt;
                .Focus()&lt;br /&gt;
                .SelectAll()&lt;br /&gt;
            End With&lt;br /&gt;
        End Try&lt;br /&gt;
        TotalRevenueDecimal += PriceInteger&lt;br /&gt;
        TotalHoursInteger += HoursInteger&lt;br /&gt;
        &lt;br /&gt;
    End Sub&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
    Private Sub PrintSummaryPrintDocument_PrintPage(ByVal sender As System.Object, ByVal e As System.Drawing.Printing.PrintPageEventArgs) Handles PrintSummaryPrintDocument.PrintPage&lt;br /&gt;
        ' Handle printing and print preview when printing page.&lt;br /&gt;
        Dim PrintFont As New Font("Arial", 12)&lt;br /&gt;
        Dim HeadingFont As New Font("Arial", 14, FontStyle.Bold)&lt;br /&gt;
        Dim LineHeightSingle As Single = PrintFont.GetHeight + 2&lt;br /&gt;
        Dim HorizontalPrintLocationSingle As Single = e.MarginBounds.Left&lt;br /&gt;
        Dim VerticalPrintLocationSingle As Single = e.MarginBounds.Top&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        ' Set up and display heading lines.&lt;br /&gt;
        e.Graphics.DrawString("Charter Summary", HeadingFont, _&lt;br /&gt;
                              Brushes.Black, HorizontalPrintLocationSingle, VerticalPrintLocationSingle)&lt;br /&gt;
        VerticalPrintLocationSingle += LineHeightSingle&lt;br /&gt;
        e.Graphics.DrawString("by Michelle Smith", HeadingFont, _&lt;br /&gt;
                              Brushes.Black, HorizontalPrintLocationSingle, VerticalPrintLocationSingle)&lt;br /&gt;
        VerticalPrintLocationSingle += LineHeightSingle&lt;br /&gt;
        e.Graphics.DrawString("Total Revenue: " &amp;amp; TotalRevenueDecimal.ToString("C"), PrintFont, _&lt;br /&gt;
                              Brushes.Black, 600, HorizontalPrintLocationSingle)&lt;br /&gt;
&lt;br /&gt;
        VerticalPrintLocationSingle += LineHeightSingle * 2&lt;br /&gt;
        e.Graphics.DrawString("Total Number of Charters: " &amp;amp; CharterCountInteger.ToString(), PrintFont, _&lt;br /&gt;
                              Brushes.Black, 600, HorizontalPrintLocationSingle)&lt;br /&gt;
        VerticalPrintLocationSingle += LineHeightSingle * 2&lt;br /&gt;
        e.Graphics.DrawString("Average Hours Chartered: " &amp;amp; AverageHoursDecimal.ToString("D2"), PrintFont, _&lt;br /&gt;
                              Brushes.Black, 600, HorizontalPrintLocationSingle)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    End Sub&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    Private Sub PrintSummaryToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PrintSummaryToolStripMenuItem.Click&lt;br /&gt;
        ' Assign the PrintSummaryPrintDocument to the preview.&lt;br /&gt;
&lt;br /&gt;
        PrintPreviewDialog1.Document = PrintSummaryPrintDocument&lt;br /&gt;
        ' Show the dialog.&lt;br /&gt;
        PrintPreviewDialog1.ShowDialog()&lt;br /&gt;
    End Sub&lt;br /&gt;
End Class&lt;br /&gt;
&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/VBasic/408786/408786/newbie-help/</guid>
      <pubDate>Tue, 03 Nov 2009 16:41:17 -0700</pubDate>
      <category>Visual Basic</category>
    </item>
    <item>
      <title>Re: VMware VCP-410 latest dumps</title>
      <link>http://www.programmersheaven.com/mb/VBasic/402402/408680/re-vmware-vcp-410-latest-dumps/#408680</link>
      <description>as for &lt;a href="http://www.passcert.com/vcp-410.html"&gt;vcp-410&lt;/a&gt;&lt;span style="color: Purple;"&gt;&lt;/span&gt;&lt;span style="font-size: small;"&gt;&lt;/span&gt; latest dumps &lt;a href="http://www.passcert.com/index.html"&gt;passcert&lt;/a&gt;&lt;span style="color: Green;"&gt;&lt;/span&gt;&lt;span style="font-size: small;"&gt;&lt;/span&gt; is another good choice for you .more revelent information you can visit &lt;a href="http://www.passcert.com/index.html"&gt;passcert &lt;/a&gt;&lt;span style="font-size: small;"&gt;&lt;/span&gt;&lt;span style="color: Red;"&gt;&lt;/span&gt;&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/VBasic/402402/408680/re-vmware-vcp-410-latest-dumps/#408680</guid>
      <pubDate>Sun, 01 Nov 2009 18:30:39 -0700</pubDate>
      <category>Visual Basic</category>
    </item>
    <item>
      <title>Error overflow 6</title>
      <link>http://www.programmersheaven.com/mb/VBasic/408601/408601/error-overflow-6/</link>
      <description>I'm getting this error. when executing the Vb code. &lt;br /&gt;
i know i need to change to Integer to Long, the length is more than 32767 so i need to change Integer to Long. but i dont know where to change i'm new to VB6. i have to do this change. please help me.Urgent...&lt;br /&gt;
&lt;br /&gt;
Guntur.=)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 Error number: 6&lt;br /&gt;
&amp;gt;&amp;gt; Error desc: Overflow&lt;br /&gt;
		AE Recs    = 0</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/VBasic/408601/408601/error-overflow-6/</guid>
      <pubDate>Fri, 30 Oct 2009 15:13:12 -0700</pubDate>
      <category>Visual Basic</category>
    </item>
    <item>
      <title>Re: ADO data control help</title>
      <link>http://www.programmersheaven.com/mb/VBasic/408293/408565/re-ado-data-control-help/#408565</link>
      <description>If you want to get instant solution then main me at soni16_sachin@yahoo.co.in.&lt;br /&gt;
&lt;br /&gt;
Please mail me only if you are ready to pay me....&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/VBasic/408293/408565/re-ado-data-control-help/#408565</guid>
      <pubDate>Fri, 30 Oct 2009 00:16:18 -0700</pubDate>
      <category>Visual Basic</category>
    </item>
    <item>
      <title>Fat Gram Calculator</title>
      <link>http://www.programmersheaven.com/mb/VBasic/408427/408427/fat-gram-calculator/</link>
      <description>It seems to be working BUT my results are in decimal form not percent and I can not figure out how to correct that.  Anyone have any ideas?&lt;br /&gt;
&lt;br /&gt;
Private Sub btnCalc_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCalc.Click&lt;br /&gt;
        Dim dblCalories As Double   'To hold calories&lt;br /&gt;
        Dim dblFat As Double        'To hold fat grams&lt;br /&gt;
        Dim dblPercentFat As Double 'To hold percent of fat&lt;br /&gt;
&lt;br /&gt;
        'Read the input.&lt;br /&gt;
        dblCalories = CDbl(txtCalories.Text)&lt;br /&gt;
        dblFat = CDbl(txtFat.Text)&lt;br /&gt;
&lt;br /&gt;
        'Calculate the percent of fat.&lt;br /&gt;
        dblPercentFat = dblFat * 9 / dblCalories&lt;br /&gt;
&lt;br /&gt;
        'Display the results.&lt;br /&gt;
        lblPercentFat.Text = CStr(dblPercentFat)&lt;br /&gt;
&lt;br /&gt;
Thanks</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/VBasic/408427/408427/fat-gram-calculator/</guid>
      <pubDate>Tue, 27 Oct 2009 15:18:29 -0700</pubDate>
      <category>Visual Basic</category>
    </item>
    <item>
      <title>Printing Using VB6</title>
      <link>http://www.programmersheaven.com/mb/VBasic/408305/408305/printing-using-vb6/</link>
      <description>I really need your help! I created a simple program in VB6 that fills in empty fields of information on a certificate. &lt;br /&gt;
&lt;br /&gt;
All I need done is for the print button to print only the LABELS (with the background and everything else transparent or not visible) that I have on the form. I have the pre printed certificates sitting in the printer with blank lines where the program I made is supposed to fill in with the information from the LABELS.&lt;br /&gt;
&lt;br /&gt;
So the problem I am having is printing. I tried PrintForm but that just prints an image of the whole form and the background ontop of my certificates. So How would I made it just print out the labels from the form?&lt;br /&gt;
&lt;br /&gt;
Please help me! I would appreciate it so much! I am a beginner so I can use all the help you can give.&lt;br /&gt;
Thanks in advance!&lt;br /&gt;
&lt;br /&gt;
(I attached an image of the rough copy of my program.)&lt;br /&gt;
&lt;br /&gt;
Tony&lt;br /&gt;
&lt;br&gt;&lt;br&gt;&lt;strong&gt;Attachment:&lt;/strong&gt; &lt;a href="http://www.programmersheaven.com/mb/DownloadAttachment.aspx?AttachmentID=1250"&gt;certificate.GIF&lt;/a&gt; (181108 bytes | downloaded 11 times)</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/VBasic/408305/408305/printing-using-vb6/</guid>
      <pubDate>Sun, 25 Oct 2009 19:21:36 -0700</pubDate>
      <category>Visual Basic</category>
    </item>
    <item>
      <title>ADO data control help</title>
      <link>http://www.programmersheaven.com/mb/VBasic/408293/408293/ado-data-control-help/</link>
      <description>Hey,&lt;br /&gt;
I got some problems. I am making a vb project using vb6 and the database is done in .accdb format. so when i use the Ado Datacontrol i use Microsoft.ACE.OLEDB.12.0 in the data connection string to connect.&lt;br /&gt;
&lt;br /&gt;
My first problem is how do i connect the database via code. In the form_load event what should i write so that i could connect to a database using the app.path syntax.&lt;br /&gt;
the code i am looking for&lt;br /&gt;
Private Sub Form_Load()&lt;br /&gt;
&lt;br /&gt;
Adodc1.connectionstring=???&lt;br /&gt;
&lt;br /&gt;
ADodc1.recordset=???&lt;br /&gt;
&lt;br /&gt;
End Sub&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;(2)&lt;/strong&gt;My second problem is: when i use the following code to search through an autonumber field it give errors.&lt;br /&gt;
&lt;br /&gt;
Adodc_mov.Recordset.Find "[movID] like '*" &amp;amp; txtsearch.Text &amp;amp; "*'", , adSearchForward&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Adodc_mov is the name of the ADO datacontrol name. MOVID is the autonumber field in the database. txtsearch.text is the search textbox.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
My third problem is: I have created a query in my database. in the query when we write the ID the specific record is displayed. i want to run this query in VB6 and show the results in a MSFLEXgrid or something like that. i want to know how to connect the query using ado datacontrol??&lt;br /&gt;
&lt;br /&gt;
HELP me.. thanks in advance..&lt;br /&gt;
Reply With Quote&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/VBasic/408293/408293/ado-data-control-help/</guid>
      <pubDate>Sun, 25 Oct 2009 12:38:37 -0700</pubDate>
      <category>Visual Basic</category>
    </item>
    <item>
      <title>Get VB Solution for all</title>
      <link>http://www.programmersheaven.com/mb/VBasic/408247/408247/get-vb-solution-for-all/</link>
      <description>Hello every one if you have any problem in VB, just send me an email on soni16_sachin@yahoo.co.in and chat with me, discuss your problem and get the solution. You will definitely get satisfaction. so hurry up!!!&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/VBasic/408247/408247/get-vb-solution-for-all/</guid>
      <pubDate>Sat, 24 Oct 2009 08:46:17 -0700</pubDate>
      <category>Visual Basic</category>
    </item>
    <item>
      <title>Re: system...</title>
      <link>http://www.programmersheaven.com/mb/VBasic/401512/408246/re-system/#408246</link>
      <description>You will get all VB solution just contact me at soni16_sachin@yahoo.co.in as soon as possible&lt;br /&gt;
you will definitely get satisfaction.&lt;br /&gt;
&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/VBasic/401512/408246/re-system/#408246</guid>
      <pubDate>Sat, 24 Oct 2009 08:42:46 -0700</pubDate>
      <category>Visual Basic</category>
    </item>
    <item>
      <title>What is the code</title>
      <link>http://www.programmersheaven.com/mb/VBasic/408219/408219/what-is-the-code/</link>
      <description>Lamp	Chair	Sofa	Table	Desk&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
New York	25	64	23	45	14&lt;br /&gt;
Chicago	        12	82	19	34	63&lt;br /&gt;
Los Angeles	54	22	17	43	35&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Item Price	$12.00	$17.95	$95.00	$86.50	$78.00&lt;br /&gt;
&lt;br /&gt;
You program should perform the following tasks:&lt;br /&gt;
1.	Load the sales data into a two-dimensional array using the sub procedure Load_Array (from a data file) and item prices into a one-dimensional array.  You will also create a string array for the cities and a string array for the items the stores sell.&lt;br /&gt;
2.	Write the initial data to the spreadsheet by city, sales item name, sales item, and price.  You should also provide column headings for the above mentioned information which should be bold and underlined.&lt;br /&gt;
3.	Write sales by store to the spreadsheet which includes sales and revenue for each store (output should include the stores’ city).  You should also provide column headings which should be bold and underlined.&lt;br /&gt;
4.	Write number of items sold to the spreadsheet which includes item name, number sold, and revenue generate.  You should also provide column headings which should be bold and underlined.&lt;br /&gt;
5.	Write total number of items sold to the spreadsheet.&lt;br /&gt;
6.	Write total revenue for all stores to the spreadsheet.&lt;br /&gt;
&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/VBasic/408219/408219/what-is-the-code/</guid>
      <pubDate>Fri, 23 Oct 2009 17:27:16 -0700</pubDate>
      <category>Visual Basic</category>
    </item>
    <item>
      <title>Heeeeeeeeeeeeeeeeeelp!!!!!!!!</title>
      <link>http://www.programmersheaven.com/mb/VBasic/408167/408167/heeeeeeeeeeeeeeeeeelp/</link>
      <description>I need your help with my project.Problem is in the sendkey under Windows XP is all ok but under Vista write access denied 70.&lt;br /&gt;
Please help me.(rewritte my project)&lt;br /&gt;
&lt;br /&gt;
THX&lt;br /&gt;
&lt;br /&gt;
Dim r As String&lt;br /&gt;
&lt;br /&gt;
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)&lt;br /&gt;
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hWnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long&lt;br /&gt;
Private Sub ExecuteLink(ByVal sLinkTo As String, ByVal Password As String)&lt;br /&gt;
Dim lRet As Long&lt;br /&gt;
Clipboard.SetText Password&lt;br /&gt;
lRet = ShellExecute(Me.hWnd, "open", sLinkTo, "", vbNull, 3)&lt;br /&gt;
Sleep (1500)&lt;br /&gt;
Sendkeys "^v", True&lt;br /&gt;
Sendkeys "{ENTER}", True&lt;br /&gt;
Clipboard.Clear&lt;br /&gt;
End Sub&lt;br /&gt;
&lt;br /&gt;
Private Sub Image3_Click(Index As Integer)&lt;br /&gt;
Dim r&lt;br /&gt;
&lt;br /&gt;
Select Case POSUN ' pdf formaty volanie z databazy&lt;br /&gt;
Case 11000&lt;br /&gt;
ExecuteLink App.path &amp;amp; "/Popis/SK/" &amp;amp; Left(DB1.Columns(0), 2) &amp;amp; ".pdf", "xxx"&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
End Sub&lt;br /&gt;
I need your help with my project.Problem is in the sendkey under Windows XP is all ok but under Vista write access denied 70.&lt;br /&gt;
Please help me.(rewritte my project)&lt;br /&gt;
&lt;br /&gt;
THX&lt;br /&gt;
&lt;br /&gt;
Dim r As String&lt;br /&gt;
&lt;br /&gt;
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)&lt;br /&gt;
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hWnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long&lt;br /&gt;
Private Sub ExecuteLink(ByVal sLinkTo As String, ByVal Password As String)&lt;br /&gt;
Dim lRet As Long&lt;br /&gt;
Clipboard.SetText Password&lt;br /&gt;
lRet = ShellExecute(Me.hWnd, "open", sLinkTo, "", vbNull, 3)&lt;br /&gt;
Sleep (1500)&lt;br /&gt;
Sendkeys "^v", True&lt;br /&gt;
Sendkeys "{ENTER}", True&lt;br /&gt;
Clipboard.Clear&lt;br /&gt;
End Sub&lt;br /&gt;
&lt;br /&gt;
Private Sub Image3_Click(Index As Integer)&lt;br /&gt;
Dim r&lt;br /&gt;
&lt;br /&gt;
Select Case POSUN ' pdf formaty volanie z databazy&lt;br /&gt;
Case 11000&lt;br /&gt;
ExecuteLink App.path &amp;amp; "/Popis/SK/" &amp;amp; Left(DB1.Columns(0), 2) &amp;amp; ".pdf", "xxx"&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
End Sub&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/VBasic/408167/408167/heeeeeeeeeeeeeeeeeelp/</guid>
      <pubDate>Fri, 23 Oct 2009 01:46:11 -0700</pubDate>
      <category>Visual Basic</category>
    </item>
    <item>
      <title>Sendkey under Vista</title>
      <link>http://www.programmersheaven.com/mb/VBasic/408160/408160/sendkey-under-vista/</link>
      <description>I need your help with my project.Problem is in the sendkey under Windows XP is all ok but under Vista write access denied 70.&lt;br /&gt;
Please help me.(rewritte my project)&lt;br /&gt;
&lt;br /&gt;
THX&lt;br /&gt;
&lt;br /&gt;
Dim r As String&lt;br /&gt;
&lt;br /&gt;
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)&lt;br /&gt;
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hWnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long&lt;br /&gt;
Private Sub ExecuteLink(ByVal sLinkTo As String, ByVal Password As String)&lt;br /&gt;
Dim lRet As Long&lt;br /&gt;
Clipboard.SetText Password&lt;br /&gt;
lRet = ShellExecute(Me.hWnd, "open", sLinkTo, "", vbNull, 3)&lt;br /&gt;
Sleep (1500)&lt;br /&gt;
Sendkeys "^v", True&lt;br /&gt;
Sendkeys "{ENTER}", True&lt;br /&gt;
Clipboard.Clear&lt;br /&gt;
End Sub&lt;br /&gt;
&lt;br /&gt;
Private Sub Image3_Click(Index As Integer)&lt;br /&gt;
Dim r&lt;br /&gt;
&lt;br /&gt;
Select Case POSUN ' pdf formaty volanie z databazy&lt;br /&gt;
Case 11000&lt;br /&gt;
ExecuteLink App.path &amp;amp; "/Popis/SK/" &amp;amp; Left(DB1.Columns(0), 2) &amp;amp; ".pdf", "xxx"&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
End Sub&lt;br /&gt;
I need your help with my project.Problem is in the sendkey under Windows XP is all ok but under Vista write access denied 70.&lt;br /&gt;
Please help me.(rewritte my project)&lt;br /&gt;
&lt;br /&gt;
THX&lt;br /&gt;
&lt;br /&gt;
Dim r As String&lt;br /&gt;
&lt;br /&gt;
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)&lt;br /&gt;
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hWnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long&lt;br /&gt;
Private Sub ExecuteLink(ByVal sLinkTo As String, ByVal Password As String)&lt;br /&gt;
Dim lRet As Long&lt;br /&gt;
Clipboard.SetText Password&lt;br /&gt;
lRet = ShellExecute(Me.hWnd, "open", sLinkTo, "", vbNull, 3)&lt;br /&gt;
Sleep (1500)&lt;br /&gt;
Sendkeys "^v", True&lt;br /&gt;
Sendkeys "{ENTER}", True&lt;br /&gt;
Clipboard.Clear&lt;br /&gt;
End Sub&lt;br /&gt;
&lt;br /&gt;
Private Sub Image3_Click(Index As Integer)&lt;br /&gt;
Dim r&lt;br /&gt;
&lt;br /&gt;
Select Case POSUN ' pdf formaty volanie z databazy&lt;br /&gt;
Case 11000&lt;br /&gt;
ExecuteLink App.path &amp;amp; "/Popis/SK/" &amp;amp; Left(DB1.Columns(0), 2) &amp;amp; ".pdf", "xxx"&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
End Sub&lt;br /&gt;
&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/VBasic/408160/408160/sendkey-under-vista/</guid>
      <pubDate>Fri, 23 Oct 2009 00:09:10 -0700</pubDate>
      <category>Visual Basic</category>
    </item>
    <item>
      <title>Help VB5</title>
      <link>http://www.programmersheaven.com/mb/VBasic/408067/408067/help-vb5/</link>
      <description>I need your help with my project.Problem is in the sendkey under Windows XP is all ok but under Vista write access denied 70.&lt;br /&gt;
Please help me.(rewritte my project)&lt;br /&gt;
&lt;br /&gt;
THX&lt;br /&gt;
&lt;br /&gt;
Dim r As String&lt;br /&gt;
&lt;br /&gt;
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)&lt;br /&gt;
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hWnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long&lt;br /&gt;
Private Sub ExecuteLink(ByVal sLinkTo As String, ByVal Password As String)&lt;br /&gt;
Dim lRet As Long&lt;br /&gt;
Clipboard.SetText Password&lt;br /&gt;
lRet = ShellExecute(Me.hWnd, "open", sLinkTo, "", vbNull, 3)&lt;br /&gt;
Sleep (1500)&lt;br /&gt;
Sendkeys "^v", True&lt;br /&gt;
Sendkeys "{ENTER}", True&lt;br /&gt;
Clipboard.Clear&lt;br /&gt;
End Sub&lt;br /&gt;
&lt;br /&gt;
Private Sub Image3_Click(Index As Integer)&lt;br /&gt;
Dim r&lt;br /&gt;
&lt;br /&gt;
Select Case POSUN ' pdf formaty volanie z databazy&lt;br /&gt;
Case 11000&lt;br /&gt;
ExecuteLink App.path &amp;amp; "/Popis/SK/" &amp;amp; Left(DB1.Columns(0), 2) &amp;amp; ".pdf", "xxx"&lt;br /&gt;
  &lt;br /&gt;
&lt;br /&gt;
End Sub&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/VBasic/408067/408067/help-vb5/</guid>
      <pubDate>Thu, 22 Oct 2009 00:02:49 -0700</pubDate>
      <category>Visual Basic</category>
    </item>
  </channel>
</rss>