ChrisPadgham 113 Posting Whiz

If you want to go low level and have a printer direct connected to the a printer port (no idea how it handles USB) you can write to it directly as follows

Open "PRN" For Output As #1
Print #1, "Here is line one"
Print #1, "Here is a text box " & Text1.Text
Close #1
ChrisPadgham 113 Posting Whiz

Just delete them, contol the whole thing from the 3 integer variables, or if you are after a quick and dirty solution simply change their .visible property to False. That way you don't need to worry about stray references to them causing problems.

ChrisPadgham 113 Posting Whiz

Well if you added a unique compound key on A, B, C then it would prevent further rows being added that violates this rule. However that does not address the issue of the existing data that violates this rule.

ChrisPadgham 113 Posting Whiz

Inside the if/then you should set

KeyAscii = 0

since you have handled it. however I don't think that will fix your error. have you tried hitting the Tab key and seeing what happens. Have a look at what is next in the tab order after the text box,

ChrisPadgham 113 Posting Whiz

Why not add a command button that has code something like.

Hours = 2
Minutes = 0
Seconds = 0

Time = TimeSerial(Hours, Minutes, Seconds)

Text1.Text = "2"
Text2.Text = "0"
Text3.Text = "0"
Timer1.enabled = true

also at line 84 why not say

if label1.caption <> "00:00:00" then

ChrisPadgham 113 Posting Whiz
SELECT a, Count(a) AS CountOfa1  FROM (SELECT Table1.a, Table1.b, Table1.c, Count(Table1.a) AS CountOfa FROM Table1 GROUP BY Table1.a, Table1.b, Table1.c) GROUP BY a;

This will return the number of combinations of "b" and "c" for each "a"

ChrisPadgham 113 Posting Whiz

There are plenty of off-the-shelf inventory control products that can do this better and cheaper than writing something yourself. If your requirements are simple there is bound to be some freeware available.

ChrisPadgham 113 Posting Whiz

I think you will find that SQL uses the american date format mm/dd/yyyy, I usually find it safer to use dd-mmm-yyyy eg 14-jun-2010

ChrisPadgham 113 Posting Whiz

just install .NET 2.0!

you are creating a support nightmare by trying to cobble together some references.

ChrisPadgham 113 Posting Whiz

Why don't you write an update SQL to update the table directly rather than bring it into a ds.

eg

UPDATE DurexBOL SET WebSvc=Yes WHERE WebSvc=No

below is the code from the vb help file for executing non-query SQL

Public Sub CreateCommand(ByVal queryString As String, _
  ByVal connectionString As String)
    Using connection As New SqlConnection(connectionString)
        Dim command As New SqlCommand(queryString, connection)
        command.Connection.Open()
        command.ExecuteNonQuery()
    End Using
End Sub
ChrisPadgham 113 Posting Whiz

Have you considered using either an array (choice 1) or a collection (choice 2) that you can iterate through

'choice 1
        Dim i As Integer
        Dim tbarray(10) As TextBox
        For i = 0 To Val(Form1.ChannelTextBox1.Text) - 1
            ' set your values
        Next i

        'choice 2
        Dim tblist As New Collection
        Dim tb As New TextBox
        tb.Parent = Me
        tblist.Add(tb)
ChrisPadgham 113 Posting Whiz

unless you are using a fixed width font such as Courier New then you are better to go with a multiple column approach. Like the one below using a list view

Dim rowvals(1) As String

        Me.ListView1.Columns.Add("Given", 50)
        Me.ListView1.Columns.Add("Surname", 70)
        ListView1.View = View.Details
        rowvals(0) = "John"
        rowvals(1) = "Smith"

        Dim newrow As New ListViewItem(rowvals)

        Me.ListView1.Items.Add(newrow)
        rowvals(0) = "Joe"
        rowvals(1) = "Bloggs"

        Dim row2 As New ListViewItem(rowvals)

        Me.ListView1.Items.Add(row2)
ChrisPadgham 113 Posting Whiz

try using the Count property of the collection to test if there are any items in the collection.

if objOffice.count > 0 then
' rest of your code from while to end while
end if

also for the future wrap you code in code /code to make it easier to read

ChrisPadgham 113 Posting Whiz

You should not be storing the total in the database it is a derived value and should be calculated on the fly as you need it.

Storing derived values increases the complexity of your application and provides for data inconsistencies to arise. For example, if they don't balance how do you know which is correct.

ChrisPadgham 113 Posting Whiz

I am thinking your approach is not completely robust. Without checking I imagine the 123.45 will return true to isnumeric which I imagine you don't want.

Personally, I am not a fan of masked text boxes because they are not that user friendly but it is a quick and easy way to achieve what you want. Use a mask of "0000000A" and set the ASCII only property to true.

If you want to test the 8th character to see if it is a letter here is the code

Dim aChar As String
        aChar = UCase$(Mid$(TextBox3.Text, 8, 1))
        If aChar >= "A" And aChar <= "Z" Then
            Label4.Text = "The 8th char is a letter"
        Else
            Label4.Text = "The 8th char is not a letter"
        End If
ChrisPadgham 113 Posting Whiz

You can use the Format$ function to pick out individual bits of a date, see code below.

<%@ Page Language="VB" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<script runat="server">


    Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs)
        TextBox1.Text = Format$(Calendar1.SelectedDate, "dd")
        TextBox2.Text = Format$(Calendar1.SelectedDate, "MM")
        TextBox3.Text = Format$(Calendar1.SelectedDate, "yy")
        
    End Sub
</script>

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Untitled Page</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:Calendar ID="Calendar1" runat="server" ></asp:Calendar>
    
    </div>
        <asp:Label ID="Label1" runat="server" Text="Day"></asp:Label>
        <asp:TextBox ID="TextBox1" runat="server" Width="58px"></asp:TextBox>
        <asp:Label ID="Label2" runat="server" Text="Month"></asp:Label>
        <asp:TextBox ID="TextBox2" runat="server" Width="61px"></asp:TextBox>
        <asp:Label ID="Label3" runat="server" Text="Year"></asp:Label>
        <asp:TextBox ID="TextBox3" runat="server" Width="47px"></asp:TextBox><br />
        <asp:Button ID="Button1" runat="server" Text="Update" OnClick="Button1_Click" />
    </form>
</body>
</html>