Auto number problem

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

    Auto number problem

    I have builed a database in access and using forms of Visual Basic6
    The problem is this
    I have a field Id which is of type long and autoincrement
    Now when i create a form and run and type my frist entry in id field like 1
    it give me the message field is not updateble.
    Plese tell me what the problem is this and how i can over come this problem.
    and how it will show ID field first auto number automatically.

    [HTML]ARALI[/HTML]
  • QVeen72
    Recognized Expert Top Contributor
    • Oct 2006
    • 1445

    #2
    Hi,

    Yes, Auto Increment Field cannot be Editted.
    If you want to show the next number, follow these steps:

    Create A Query Object with following query:
    SELECT Max(SlNo)+1 AS NextNumber FROM MyTable;
    Save with Some name.

    Now Create a Form For this Query... say frmNextNumber

    Drag and Drop This frmNextNumber on your Main Form..

    Regards
    Veena

    Comment

    • Killer42
      Recognized Expert Expert
      • Oct 2006
      • 8429

      #3
      Originally posted by QVeen72
      ...Now Create a Form For this Query... say frmNextNumber
      Drag and Drop This frmNextNumber on your Main Form
      Unless, of course, you happen to be using Visual Basic for the forms, rather than Access. In which case this may not apply.

      But as QVeen72 points out, the whole point of an "autonumber " field is that the value is generated automatically by Access. You can display it, but you cannot edit it.

      Comment

      • arali
        New Member
        • Jan 2008
        • 24

        #4
        Originally posted by QVeen72
        Hi,

        Yes, Auto Increment Field cannot be Editted.
        If you want to show the next number, follow these steps:

        Create A Query Object with following query:
        SELECT Max(SlNo)+1 AS NextNumber FROM MyTable;
        Save with Some name.

        Now Create a Form For this Query... say frmNextNumber

        Drag and Drop This frmNextNumber on your Main Form..

        Regards
        Veena
        Hello Veena
        Thanhs for your help but iwas unable to do what you said.
        Please tell me how to drag and drop a form on another form
        and tell what to do with my problem other than that.
        Regards
        [HTML]ARALI[/HTML]

        Comment

        • QVeen72
          Recognized Expert Top Contributor
          • Oct 2006
          • 1445

          #5
          Originally posted by arali
          Hello Veena
          Thanhs for your help but iwas unable to do what you said.
          Please tell me how to drag and drop a form on another form
          and tell what to do with my problem other than that.
          Regards
          You are using VBA..? or VB6..?

          Regards
          Veena

          Comment

          • arali
            New Member
            • Jan 2008
            • 24

            #6
            Originally posted by QVeen72
            You are using VBA..? or VB6..?

            Regards
            Veena
            I am using Vb 6
            Regards
            ARALI

            Comment

            Working...