PDA

View Full Version : Auto-increment won't work after upgrade to V5


ABC123

Peter Hall
03-17-2005, 02:58 PM
I just updated my Alpha Five V1 to V5. I keep track of all my CD's. The parent table keeps track of the album info and the child table keeps track of the individual tracks. With my old program I could auto-increment the track # in the form with an imbedded browse. All I would have to do is insert a "1" in the track # field and the rest would follow. I get a "0" in the entry every time. If I set the value after I enter a value I can put one in, but once it's set the only way to change it is to change the field rule to user entered. Is this a step backward or is there a way around this.
Thanks in advance,
Frustrated (Peter)

Cheryl Lemire
03-17-2005, 04:15 PM
Peter,

We all get frustrated when there are not automatic ways for us to accomplish our tasks. Your searching the forum on auto increment to try and find a solution is a good thing, however, consistently saying that you are frustrated as you find them ... is not the best way to get assistance.

I understand what you are looking for, but what you need is not really auto incrementing. As you noted in the auto increment help files, it is designed to ensure for unique values. You are not asking for unique values.

You can accomplish your task using a lookup table that holds the values 1-20 and select from the list for your specific record to show the track number. You could also write a custom auto increment script/function perhaps using your unique identifier field from your parent table as the beginning portion of the incremented number in the tracks which would then allow your child tables to begin with '1' and end at whatever number the last track for that cd is. You would then subtract the beginning portion of your incremented id in your reports for display purposes.

These may not be the easiest solutions for you, or even what you want to do, but there are always ways to achieve what you need.

Maybe others will have other suggestions for your particular situation ... there are many ways to skin a cat.

Good luck
Cheryl

Peter Hall
03-17-2005, 04:23 PM
Thanks for your suggestions Cheryl. I'm sure there is a workaround. I just think that when the made auto-increment into a unique number generator they weren't thinking of the people who were using it as just an aid to entering data. That was a workaround that I found in A5 V1 and now I find that they have taken that away from me.
Thanks again,
Peter.

Cheryl Lemire
03-18-2005, 07:34 AM
Peter,

Tom E Cone, Jr has come up with a solution for you. I will need some time to put it together though. This solution will allow you to have your incremented field in the way you were used to in the older version. As soon as I have some instruction available I will attach it to this post.

Thanks
Cheryl

Cheryl Lemire
03-18-2005, 12:06 PM
Peter,

I apologize for the delay in getting this information to you. I have had a jam packed day. The solution to your problem is quite simple.

Using the previous() function in the field rules for your track number field, the track number will automatically be incremented AND you will be able to change the value so that it starts over with number '1'.

Tom E Cone, Jr created the attached sample db for you. Note the field rules for the track_num field, data entry tab:

Previous("Track_No")+1

Open the default browse for the table and enter a new record. The sample has the CD Title taken from the previous() as well, you can change this when you want a new title to test the incrementing and ability to change the increment value for your track number field. I am assuming that the CD title field in your table is automatically populated.

Good luck
Cheryl

Peter Hall
03-18-2005, 08:14 PM
Thanks so much Cheryl & Tom. I am just getting used to the changes that have occurred over the last 10 years and that saved me a lot of time. I like what I see. Thanks so much for the support, for now I am a lot happier with my new purchase. I'm sure there are quite a few others that are going to appreciate this as well.
Thanks again,
Peter.

Lynda Huddleston
03-25-2005, 08:01 AM
When I switched from V4 to V5 I was very frustrated as well. So many of the things I was doing before had changed.
I have found however, that the changes are much more dynamic, much more "windows" style based and give me easier solutions - it just took a long time to re-learn

Keep posting questions, and you will get there.

Lynda Huddleston
03-25-2005, 08:04 AM
Can't you also do an "if" statement:

If(previous,"title")="title",(previous,"track")+1,1)

This would then see that as long as the cd title is the same it would keep adding for you on the track, but when different, it would start at 1?

Peter Hall
03-25-2005, 11:20 AM
Thanks so much Lynda. That sounds like that would work. The field that I used for linking in my Set was a character field. The first position being an alphabetic character (that I used for a code to break my CD's into categories)followed by 4 digits (used as a serial #). The letter "C" stood for a burned disc, "A" for retail disc, "V" stood for Discs made from Various artists, etc. The problem that I encountered was entering in my burned discs (C) after entering in (V) various discs. The index wouldn't allow me to start my "cut #" at "1", as the last "V" disc's cut # was "16" it would keep changing to "17". I divided my linking field into 2 fields (category & Disc)using "Update" and linked on "Disc". Everything works fine, better than ever actually. I never have to set the cut # back to "1", (See Cheryl's message above 79136 on how)it does it automatically and I can even automatically enter the "Artist" field in the child table from the same field in the parent field. Most of the keying in the child table is done automatically. You are right. Everyday I learn things that make my new purchase well worth the money. Things that I spent hours figuring out with the old program are just a "click" on a drop down list. Awesome!