2
Contributors
4
Replies
8
Views
8 Years
Discussion Span
Last Post by Naveed_786
0

Hi,

Here's a way how to do it.

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        Dim Low As Integer = 0
        Dim High As Integer
        High = 10 ' max integer
        Get_Random(Low, High)


    End Sub

    Sub Get_Random(ByVal Low As Integer, ByVal High As Integer)

        TextBox1.Text = Math.Floor((High - Low + 1) * Rnd() + Low)

    End Sub

Edited by Luc001: n/a

0

Thanks for your help nut it s generating 7 by default.

I want to generate auto number every time when form loaded please help me.

0

Hi,

On form load, try this;

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Randomize()
        TextBox1.Text = Int(Rnd() * 10)

    End Sub
0

it is generating 7 every time form load ok let me explain

1. I want to generate auto number stating from 1
2. Then i want to increment it at evey transaction.

or

Is it possible that it every time generate auto number every time when form loaded?

Please help me if it is possible.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.