Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

I've never personally had a problem with Dells and there have been five in my immediate family. On the rare occasions I've had to get service it was always easily arranged with a fast turnaround time. I was even able to get a replacement battery out at the cottage in the middle of nowhere.

I won't condemn Toshiba forever, but a few years ago we had a problem with a batch of them at the office. A design flaw caused the hard drives to fail on a regular basis. Toshiba admitted the problem was theirs but refused to repair/replace. We are talking about 10-15 laptops. That decision by Toshiba caused my company to switch from Toshibas to Thinkpads. In a corporation of 5000 people, that amounted to a hefty chunk of change that Toshiba lost.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

You could use the COALESCE function. Given two or more parameters, it evaluates to the first parameter that is not null.

SELECT fieldName = COALESCE(fieldName,0) FROM myTable
SELECT fieldName = COALESCE(fieldName,'0') FROM myTable

will replace all null values with 0 or '0' in the returned data depending on whether the field is numeric or string.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Judging by the other post I'm assuming MS Access. I suggest you have a look at the W3 SQL Tutorial

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Is there a question?

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

No real information but I do have an anecdote. Back in the '80s I was part of a team of five programmers who maintained an AGC/SCADA system (rrealtime). My boss was one of the programmers who worked on the development of the system. We had to rely on him to give us an overview of the sytem once it was delivered and commissioned. What I can tell you is that the man would explain the concept of a beach by describing each grain of sand on it. He spoke volumes but imiparted absolutely nothing of vale.

Above all, a technical writer must at all times be aware of the target audience. A technical writer should avoid jargon wherever possible. Sometimes technical terms are unavoidable but they should be kept to a minimum. Your job is to be clear and concise; to inform, not to impress. Avoid the trendy new buzzwords. For example, in a phrase like "the system was architected to perform...", the word "architected" should be replaced with the word "designed". Don't use a fancy word or phrase (utilize a methodology) when a simple word or phrase (use a method) will do as well. Don't use a foreign word when a non-foreign word will do as well. You get my drift.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

We are not going to teach you everything you need to know about databases. I suggest you do a little googling. You can start with W3 SQL Tutorial.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

And even if it is read only you can still set the background colour to anything you want. Or you could just use a label control.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Have you considered a career in technical writing? Your thoughts are clear and well organized and you seem to have a good grasp of proper grammar. There is a demand for people with those skills.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

I always thought it was"upsy daisy".

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Please post your code. My guess is you are modifying the in-memory copy of the table but not saving it to the database.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

That's not quite true. To get the short-circuit form you have to use

If Not_Business OrElse IsEmpty(DOB.Text) Then

If you use Or or And instead of OrElse or AndAlso then the entire expression is evaluated. This can be a problem if the second part of the expression can return an error under some conditions. For example, checking the value of the first item in a recordset will cause an indexing error if rec.EOF is true. So

If Not rec.EOF And rec(0).Value = 5 Then

could cause an error whereas

If Not rec.EOF AndAlso rec(0).Value = 5 Then

will not because the second part is evaluated only if EOF is False.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Then you can get the next available ID number by

SELECT nextID=MAX(ID)+1 FROM mytable

Just remember not to specify ID when you save the record or you will get an error.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

What is the code behind Knock()? You could always create a sound file that has the desired sound repeated. Then you would only have to call the routine once as

KnockKnock()
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Do you mean that when you bring up a blank form (so you can create a new entry) the ID number of the record that will be added is displayed? The answer depends on whether or not there is only one user hitting the database at a time.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

What is the problem?

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster
If DOB.Text = "" Then
    Not_Business = True
    MessageBox.Show("missing dob")
End If
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

The statement

Not_Business = True & MessageBox.Show("missing dob")

is invalid. MessageBox returns type DialogResult. You have to compare that result to something to get a boolean. Example

If MessageBox.Show("missing dob") = DialogResult.yes

What are you trying to accomplish with that statement?

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

There is no such thing as a SQL form, and reading information from an ini file does not require SQL.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Try

rec.Open "select * from Body_Markings_new where [Part Number] like '%" & txtsearch.Text & "%' ", conn, adOpenDynamic, adLockOptimistic

It's my own preference, but I always avoid putting spaces in field names. It always leads to problems like this.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Do you think you can still get parts to repair your old 8-track cassette deck? Or any cassette deck?

How long do you expect car manufacturers to keep supporting old vehicles? Do you expect to go into a parts store and get a carburator for a '59 ford sedan? Would you expect to find seatbelts and airbags on a 50 year old vintage auto? Or anti-lock brakes?

Like it or not, Windows XP just does not support the advanced security that is built into modern operating systems and it is unreasonable to expect Microsoft to waste any more effort on shoehorning in patch after patch to try to keep Windows XP secure.

Now the question become why does this thread refuse to die?

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

He could have written

Imagine no more countries.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

You could always specify a specific action for each handler if you use the first approach.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

The last four parameters are

forward    
    true to move forward in the tab order; false to move backward
tabStopOnly  
    true to ignore the controls with the TabStop property set to false; otherwise, false.
nested
    true to include nested child controls; otherwise, false.
wrap
    true to continue searching from the first control in the tab order after the last control has been reached; otherwise, false.
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

I think a better way to do this would be

Private Sub TextBox1_KeyPress(sender As System.Object, e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress
    If e.KeyChar = vbCr Then
        Me.SelectNextControl(Me.ActiveControl, True, True, True, True)
        e.Handled = True
    End If
End Sub

Private Sub TextBox2_KeyPress(sender As System.Object, e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox2.KeyPress
    If e.KeyChar = vbCr Then
        Me.SelectNextControl(Me.ActiveControl, True, True, True, True)
        e.Handled = True
    End If
End Sub

Or even

Private Sub TextBox1_KeyPress(sender As System.Object, e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress, TextBox2.KeyPress
    If e.KeyChar = vbCr Then
        Me.SelectNextControl(Me.ActiveControl, True, True, True, True)
        e.Handled = True
    End If
End Sub
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

POST stands for Power On Self Test. If you are getting this message then you may have a hardware problem. Is there a boot option to boot into a diagnostic mode? If not then you may have to go to another computer and see if there is a stand-alone diagnostic disk available for download from the manufacturer for your computer. If you are unable to boot to a diagnostic disk (I don't know what you were trying to boot to from the CD) then it may be time for a trip to the repair shop. Some computers will emit a series of beeps to indicate a failure of a particular component. Are you getting any sounds during boot up?

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Or a daniweb logo you could print on a decal and apply to a blank mug.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

There's an old saying (I don't know who said it first) that goes "I write all my time critical routines in assembler and all my comedy routines in BASIC.".

Having said that, you will usually find me in the vb.NET forum.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

A handy reference for regular expressions can be found here. It also includes an area for interactive testing of regular expressions. You can use the provided sample text or paste your own sample text and refine the expression until it gives you the results you want.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

The good part is there is never a problem making decisions (and you can still get advice from other people - you just don't have to take it). The bad part is there is no one else to blame when things go into the toilet. Here's a quote from the workplace...

I didn't say it was your fault. I just said I was blaming you.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

For my first 2 years or so of professional programming I was a one-person shop. I did the conception, design, coding, debugging and integration. I didn't know how good I had it until I took a job that involved other programmers and (shudder) engineers. The above article was just as true in the 1980s as it is today.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

This is just too good not to share with everyone.

The only reason coders' computers work better than non-coders' computers is coders know computers are schizophrenic little children with auto-immune diseases and we don't beat them when they're bad.

From Programming Sucks. A must-read.

pritaeas commented: Brilliant +0
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Nobody can say with any certainty what languages will still be around in 20 years. Even 5 years is difficult with some. If you want to port old VB programs with as little difficulty as possible I suggest just going to vb.net. I think you'll find porting vb to C++ will be much more difficult. A few years back (closer to 20) I had to port a very large and complex program from vb to FORTRAN, and then later on to C. It required a complete rewrite both times and neither experience was pleasant. The positive aspect, however, was that a complete rewrite allowed me to make great improvements in the design.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

At this point, aside from giving you the solution, there is not much else I can do. As has been said here many times before, we will help but we will not do your homework for you.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Never heard of it. What is it?

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

You can say the same thing about bullets (no - I'm not trying to start that up again) - perfectly harmless unless you happen to get in the way of one.

@ddanbe - Thanks. I'm sure in a couple of weeks we'll be back at the cottage for the summer and saying that (once the good weather arrives) that the winter wasn't as bad as we once thought. Then we can get on with the summer activity - complaining about the mosquitoes.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

If a field has been designated as AUTONUMBER then you cannot include it in the insert query. If you want to insert all records from the temp table into the permanent table you must specify all the fields except the AUTONUMBER field in the select statement. For example, if I a table

table_1
ID          int (PK AUTO NUMBER)
field1      varchar(50)
field2      varchar(50)

I can create a temp table by

SELECT * INTO temp FROM table_1

but to add those records back into table_1 I must do

INSERT INTO table_1 SELECT field1, field2 FROM temp

Because you said the temp table is a copy (in structure) of the permanent table then the ID field is also AUTONUMBER and wiill not allow you to insert a record which has the ID field.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

If you only need the values available for the duration of the calculation (once the button_click exits the variables can "go away") then you can declare the array in the handler, otherwise you can declare it at the class level. You would do something like

Private Sub btnCompute_Click(sender As Object, e As EventArgs) Handles btnCompute.Click

    Dim scores(4) As Single
    Dim numScores As Integer = 5
    Dim total As Single = 0.0
    Dim i As Integer = 0

    Do While i <= 5

        Dim prompt As String = "Enter score " & i & " of " & numscores)
        Dim str As String = InputBox(prompt)

        'Here you should verify that what the user entered is a number
        '1) numeric
        '2) a number between 0 and 100
        'If it fails the validation then you should tell the user why.
        'If it passes then you can save the score in the array and add
        '1 to i.

    Loop

To add it to the array you just do

scores(i-1) = CSng(str)
total += scores(i-1)
i += 1

You have to use i-1 as the index because the indices run from 0 to 4 and we have i running from 1 to 5 (you don't want to ask the user, for example, to enter score 0 because that's not how people count).

Once you are done getting all the valid scores you'll need another loop to calculate the variance (which you need to find the standard deviation).

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

The standard deviation is the square root of the variance and the variance is the squared differences from the mean. So to get the variance you must

  1. calculate the mean (average) of the numbers
  2. subtract the mean from each number and square it
  3. find the mean of the squared differences

So if you have five test scores with values 98, 57, 72, 88 and 91 the average is

(98 + 57 + 72 + 88 + 91) / 5 = 81.2

The differences from the mean are

16.8, -24.2, -9.2, 6.8, 9.8

The variance is

(16.8**2 + -24.2**2 + -9.2**2 + 6.8**2 + 9.8**2) / 5 =  218.96

and the standard deviation is

SQRT(218.96) = 14.797

You can see that you can't calculate the variance until you know the mean, and you won't know the mean until you have input all of the numbers. So that tells you that you must keep all of the scores in an array so that you can step through them again. Give this a thought and see how you make out. I'll check bak in a while.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

filter up every Company ID on keeping only two records

What exactly do you mean by this?

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

I saw that on the news yesterday. I'm glad it missed you. I think I'll stop complaining about the snow now.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

I don't believe the first query will do anything. The syntax is

WHERE [SOMEVALUE] NOT IN (LIST OF VALUES)

however your syntax is

WHERE [SOMEVALUE] NOT IN (RECORDSET)

What exactly are you trying to do? The second query should work but because I don't know what you are trying to do I can't say whether it will do what you want.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

To start with, you do

strInput = InputBox("Please Enter Test Scores", "Enter Score")

which prompts the user to enter the test scores. Then (supposedly once the user enters the scores) you ask for 10 more scores in

For intCounter = 1 To 10 Step 1

Before the loop you set sngTotal to 100 although I do not know why. Then in the loop you replace the value of sngTotal with the statement

sngTotal = (strInput)

That's not going to accomplish much except generate an error because you are assigning a string to a numeric. And even if it worked you are just throwing away the first nine values entered.

Try to write out what you want to do in pseudo-code before you write actual code.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Try doing a SELECT COUNT(*) on the record with that ID. If you get a result of 0 then the record does not exist.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

I have a feeling that this is a homework assignment.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

In the last week or so I posted a new tutorial on creating and managing background threads. You can find it here.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

You can set the attributes in vb.net.

I don't think that allows you to play with the access lists, just the regular attributes (read, hidden, system, archive).

If you go the icacls route you could just create a cmd file with an icacls command on each line (one for each folder).

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Go to a command prompt (running as administrator) and type

icacls /?

I think you want the

/remove[:[g|d]] Sid removes all occurrences of Sid in the ACL. With
    :g, it removes all occurrences of granted rights to that Sid. With
    :d, it removes all occurrences of denied rights to that Sid.    

parameter. If you don't want to use icacls then right click the folder, select Properties, then go to the Security tab. Select the username you want to edit and modify the access rights from there.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Try removing the single quotes from the numeric fields as in

qry = "SELECT * FROM [per_diem_accomodation] " &
      " WHERE [project number]  = " & projcode & 
      "   AND [employee number] = " & empcode  &
      "   AND [current month]   = '" & resultdate & "'"

Also, you didn't say what the backend database was. If it is Access then you should delimit the date with # instead of single quotes. In any case you should be using parameterized queries.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

What's wrong wih google translate?

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Not to mention idioms. How do you translate "have a ball" into another language and have it mean the same thing? There's a big difference between knowing the words, knowing the language and knowing the culture. There's an old Dutch (according to my dad) expression, "he landed with his a$$ in the butter". I would guess this is untranslatable (at least so that it makes sense) by any software.

ddanbe commented: LOL :) +15