how to set up input mask in a autonumber field?

Discussion in 'OT Technology' started by speedlife, May 5, 2003.

  1. speedlife

    speedlife Guest

    i have this field that is autonumbering but i want it to be like this

    0001-py-2003
    next record would then be
    0002-sy-2003
    0003-sy-2003
    etc
    0014-sy-2003

    there is not an input mask part when selecting a field as an autonumber. can i put a statement in the format portion? if so, what can i write so my output looks like the above

    thanks
     
  2. 5Gen_Prelude

    5Gen_Prelude There might not be an "I" in the word "Team", but

    Joined:
    Mar 14, 2000
    Messages:
    14,519
    Likes Received:
    1
    Location:
    Vancouver, BC, CANADA
    0000"-sy-2003"

    I'm assuming your first example was a typo.
     
  3. speedlife

    speedlife Guest


    yea sorry about that. :slap:

    do i just put that statement in the format field?
     
  4. 5Gen_Prelude

    5Gen_Prelude There might not be an "I" in the word "Team", but

    Joined:
    Mar 14, 2000
    Messages:
    14,519
    Likes Received:
    1
    Location:
    Vancouver, BC, CANADA
  5. speedlife

    speedlife Guest

    nice. thanks. last question.
    how do i reset the autonumber to zero after deleting all records?
     
  6. 5Gen_Prelude

    5Gen_Prelude There might not be an "I" in the word "Team", but

    Joined:
    Mar 14, 2000
    Messages:
    14,519
    Likes Received:
    1
    Location:
    Vancouver, BC, CANADA
    You don't. One way to do it is to copy and paste the table, delete the original, and then rename the copy. If you do this on a regular basis, you don't need to delete the records, just copy the structure only.
     
  7. speedlife

    speedlife Guest

    i did the input mask as instructed and it shows up on the table. but when i access that table through the form, the input mask does not look evident. any changes to the table, do i have to make the same changes in the design view of the form?

    i just recreated that same form from the new revised table and it looks ok. im thinking, if you make any changes to the table when the form has been created already, one has to make changes to the form as well? it does not trickle down automatically?
     
  8. 5Gen_Prelude

    5Gen_Prelude There might not be an "I" in the word "Team", but

    Joined:
    Mar 14, 2000
    Messages:
    14,519
    Likes Received:
    1
    Location:
    Vancouver, BC, CANADA
    Basically yeah, the field itself hasn't changed, just the layout. Think of it as a template that is used when creating controls and such, but changing it at the table level won't change exisiting formats (that wouldn't be very good in some cases)
     
  9. speedlife

    speedlife Guest

    why wouldnt it be good in some cases? i would think any layout changes in the table, one would want tos ee it in the form?


    also how do you lock out a query from being able to change data
    i noticed some query are read only
     
    Last edited by a moderator: May 6, 2003
  10. 5Gen_Prelude

    5Gen_Prelude There might not be an "I" in the word "Team", but

    Joined:
    Mar 14, 2000
    Messages:
    14,519
    Likes Received:
    1
    Location:
    Vancouver, BC, CANADA
    Well for example, the format command can be used to do a vareity of things. Let's say you want people to enter in an invoice date. So you set the format to a general date format. Now let's say you want to display all of the invoices but only show the month. There are a number of ways to do this, but one way would to simply show the month, instead of the entire date field. Or lets say you want to know what time of the day the invoice was produced so you have an idea when the peak period is. In most reports, you don't need all that info, so changing the format at the table level would cause all kinds of cascading problems for different reports, forms, etc... Trust me, it would be helpful in your specific situation, but in the long run, the ability to override the default format view of the field is beneficial.

    As for your query question, it's all a matter of how you design the query with joins and setting relationships up prior to joining them.

    A book about Access might be a useful tool if you are doing this much work in it. Most of your questions could be answered by it, and probably more clearly than myself!
     

Share This Page