By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,972 Members | 1,092 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,972 IT Pros & Developers. It's quick & easy.

Display auto numbers in textbox in VB

P: 24
please solve my problem and give me the code
Jan 4 '08 #1
Share this Question
Share on Google+
10 Replies


jamesd0142
100+
P: 469
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?
Jan 4 '08 #2

lotus18
100+
P: 866
please solve my problem and give me the code
Can you show us what have you done so far?
Jan 4 '08 #3

daniel aristidou
100+
P: 491
Is this a school project or something similar?
if so we will help you not give ready code
Jan 4 '08 #4

P: 24
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 6
Jan 5 '08 #5

Expert 100+
P: 487
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.)
Jan 5 '08 #6

100+
P: 274
But we can him how it can be done .
Jan 5 '08 #7

Expert 100+
P: 487
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.Text =
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.
Jan 5 '08 #8

P: 24
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.Text =
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.
I have access at back end and vb at front 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 blanck
Jan 7 '08 #9

werks
100+
P: 220

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.

Expand|Select|Wrap|Line Numbers
  1. Dim adoNum as New Adodb.Recordset
  2. Set adoNum = New Adodb.Recordcount
  3.  
  4. adoNum.Open "SELECT * FROM tblData",CoNN,3,3
  5.  
  6. txtInputNo.Text =  adoNum.Recordcount + 1
  7.  
  8. adoNum.Close
  9. Set adoNum = Nothing
Hope this will help ^^


Better Than Yesterday (-.-)
Jan 8 '08 #10

P: 24
Hi there, arali!

Just get the RecordCount and add it by 1.

Expand|Select|Wrap|Line Numbers
  1. Dim adoNum as New Adodb.Recordset
  2. Set adoNum = New Adodb.Recordcount
  3.  
  4. adoNum.Open "SELECT * FROM tblData",CoNN,3,3
  5.  
  6. txtInputNo.Text =  adoNum.Recordcount + 1
  7.  
  8. adoNum.Close
  9. Set adoNum = Nothing
Hope this will help ^^


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,command2.
Thank you iam waiting for your kind response.

Regards
<<Arali>>
Jan 17 '08 #11

Post your reply

Sign in to post your reply or Sign up for a free account.