Display auto numbers in textbox in VB

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • arali
    New Member
    • Jan 2008
    • 24

    Display auto numbers in textbox in VB

    please solve my problem and give me the code
  • jamesd0142
    Contributor
    • Sep 2007
    • 471

    #2
    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

    • lotus18
      Contributor
      • Nov 2007
      • 865

      #3
      Originally posted by arali
      please solve my problem and give me the code
      Can you show us what have you done so far?

      Comment

      • daniel aristidou
        Contributor
        • Aug 2007
        • 494

        #4
        Is this a school project or something similar?
        if so we will help you not give ready code

        Comment

        • arali
          New Member
          • Jan 2008
          • 24

          #5
          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

          Comment

          • CyberSoftHari
            Recognized Expert Contributor
            • Sep 2007
            • 488

            #6
            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

            • creative1
              Contributor
              • Sep 2007
              • 274

              #7
              But we can him how it can be done .

              Comment

              • CyberSoftHari
                Recognized Expert Contributor
                • Sep 2007
                • 488

                #8
                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

                • arali
                  New Member
                  • Jan 2008
                  • 24

                  #9
                  Originally posted by CyberSoftHari
                  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.
                  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

                  Comment

                  • werks
                    New Member
                    • Dec 2007
                    • 218

                    #10
                    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.

                    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
                    Hope this will help ^^


                    Better Than Yesterday (-.-)

                    Comment

                    • arali
                      New Member
                      • Jan 2008
                      • 24

                      #11
                      Originally posted by werks
                      Hi there, arali!

                      Just get the RecordCount and add it by 1.

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

                      Regards
                      <<Arali>>

                      Comment

                      Working...