Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Form counter

Form counter

Form counter

I have been looking for an easy way to give a new form a number each time a user enters one.

Like in a help desk where call 1000 would be the first call and the next form would have a call number 1001 (auto)

I guess this is not easy as some of the code to do it I have look at is a tad on the hard side.

So how can I have a field on a form that is added to each time a new form is opened.

Hope that is clear !

RE: Form counter

One way I've done this in previous projects is to generate a number based on the date and time the form was created. This would create a new number every minute. The only drawback would be if two documents where created in the one minute.

The following code generates a number like 14073-1706 if the form was created on July 14 03 at 1706. Just use it as the default value of a Computed When Composed field.

YearString := @Right(@Text(@Year(@Now)); 1);
MonthString := @If(@Month(@Now) >= 10; @Text(@Month(@Now)); "0" + @Text(@Month(@Now)));
DayString := @If(@Day(@Now) >= 10; @Text(@Day(@Now)); "0" + @Text(@Day(@Now)));
HourString := @If(@Hour(@Now) >= 10; @Text(@Hour(@Now)); "0" + @Text(@Hour(@Now)));
MinuteString := @If(@Minute(@Now) >= 10; @Text(@Minute(@Now)); "0" + @Text(@Minute(@Now)));
@If(@IsNewDoc;DayString + MonthString + YearString + "-" + HourString + MinuteString;fieldname)

Hope this helps

RE: Form counter

Thanks guys. Helped me some but still not got it to work !!

Thanks for your time

RE: Form counter

Thanks for the help folks got it working now.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close