please solve my problem and give me the code
Display auto numbers in textbox in VB
Collapse
X
-
I'm sure someone including me, would help, if you could give some additional details...
What are you trying to occomplish?
What version of vb.
What exaclty do you mean by autonumber in a textbox? -
Comment
-
i want to do this
input no.15 Name.--------------
address.-----------------------
now i want to do this when i open form it atumatically show me the current input no and other fields remain blank so i can input data to these fieldes.when i done this and click save button.it atumatically diplays next input number and other fieldes remain blank.this is my school project.iam using vb 6Comment
-
Doing homework is prohibited and you have to try your self. I suggest you to read posting guidelines. Describe you problem detail (you have to ask your query along with what you tried.)Comment
-
1. Call the method which will get max(Inputnumber ) + 1 from the database and show it in textbox at form load.
2. Other textboxes like textboxName.Tex t = “”
3. Call the above (same) method in save command click event after insert query.
Note: Assuming solution will point in wrong direction. He/She should explain the problem detail with front-end and back-end.Comment
-
I have access at back end and vb at front endOriginally posted by CyberSoftHari1. Call the method which will get max(Inputnumber ) + 1 from the database and show it in textbox at form load.
2. Other textboxes like textboxName.Tex t = “”
3. Call the above (same) method in save command click event after insert query.
Note: Assuming solution will point in wrong direction. He/She should explain the problem detail with front-end and back-end.
now please till me how to do this
inputno.15 name.
age. address.
now when i open the form it shows me just input no and other remains blanckComment
-
Originally posted by arali
inputno.15 name.
age. address.
now when i open the form it shows me just input no and other remains blanck
Hi there, arali!
Just get the RecordCount and add it by 1.
Hope this will help ^^Code:Dim adoNum as New Adodb.Recordset Set adoNum = New Adodb.Recordcount adoNum.Open "SELECT * FROM tblData",CoNN,3,3 txtInputNo.Text = adoNum.Recordcount + 1 adoNum.Close Set adoNum = Nothing
Better Than Yesterday (-.-)Comment
-
Originally posted by werksHi there, arali!
Just get the RecordCount and add it by 1.
Hope this will help ^^Code:Dim adoNum as New Adodb.Recordset Set adoNum = New Adodb.Recordcount adoNum.Open "SELECT * FROM tblData",CoNN,3,3 txtInputNo.Text = adoNum.Recordcount + 1 adoNum.Close Set adoNum = Nothing
Better Than Yesterday (-.-)
thank for your help
Now i use data connection to connect Access database
and Add two commands
One command is based on SQL Query
select max(input no) +1 from mytable
I bind this command to textbox Now it show me the next inputno
And the second command is use d for the table other fields
the point is all the fields is of the same table including inputno ,but using two commands .
now tell me how i write codding for Save button.So it can store inputno and other fields data.
name of connection is connection1
And name command are command1,comman d2.
Thank you iam waiting for your kind response.
Regards
<<Arali>>Comment
Comment