When I set up this bit of code, every time I debug the software it generates the same number. Can anyone tell me why this is happening?
dim value as integer
Since this was tagged as .Net you should not be using VB6 legacy functions. For .Net use the Random Class Here is an example that requires a button and a label.
Public Class Form1
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Label1.Text = GenRandInt(100).ToString
End Sub
Private Shared prng As New Random 'only need one - should not be in a method
Private Function GenRandInt(maxValue As Integer) As Integer
'returns an integer between 0 and maxValue inclusive
Return prng.Next(maxValue + 1)
End Function
End Class
Read the documentation for the details and other uses of the Random class.
edit: If for some reason you decide to continue to use Rnd, then call Randomize before using it.