Alpha Software Mobile Development Tools:   Alpha Anywhere    |   Alpha TransForm subscribe to our YouTube Channel  Follow Us on LinkedIn  Follow Us on Twitter  Follow Us on Facebook

Announcement

Collapse

The Alpha Software Forum Participation Guidelines

The Alpha Software Forum is a free forum created for Alpha Software Developer Community to ask for help, exchange ideas, and share solutions. Alpha Software strives to create an environment where all members of the community can feel safe to participate. In order to ensure the Alpha Software Forum is a place where all feel welcome, forum participants are expected to behave as follows:
  • Be professional in your conduct
  • Be kind to others
  • Be constructive when giving feedback
  • Be open to new ideas and suggestions
  • Stay on topic


Be sure all comments and threads you post are respectful. Posts that contain any of the following content will be considered a violation of your agreement as a member of the Alpha Software Forum Community and will be moderated:
  • Spam.
  • Vulgar language.
  • Quotes from private conversations without permission, including pricing and other sales related discussions.
  • Personal attacks, insults, or subtle put-downs.
  • Harassment, bullying, threatening, mocking, shaming, or deriding anyone.
  • Sexist, racist, homophobic, transphobic, ableist, or otherwise discriminatory jokes and language.
  • Sexually explicit or violent material, links, or language.
  • Pirated, hacked, or copyright-infringing material.
  • Encouraging of others to engage in the above behaviors.


If a thread or post is found to contain any of the content outlined above, a moderator may choose to take one of the following actions:
  • Remove the Post or Thread - the content is removed from the forum.
  • Place the User in Moderation - all posts and new threads must be approved by a moderator before they are posted.
  • Temporarily Ban the User - user is banned from forum for a period of time.
  • Permanently Ban the User - user is permanently banned from the forum.


Moderators may also rename posts and threads if they are too generic or do not property reflect the content.

Moderators may move threads if they have been posted in the incorrect forum.

Threads/Posts questioning specific moderator decisions or actions (such as "why was a user banned?") are not allowed and will be removed.

The owners of Alpha Software Corporation (Forum Owner) reserve the right to remove, edit, move, or close any thread for any reason; or ban any forum member without notice, reason, or explanation.

Community members are encouraged to click the "Report Post" icon in the lower left of a given post if they feel the post is in violation of the rules. This will alert the Moderators to take a look.

Alpha Software Corporation may amend the guidelines from time to time and may also vary the procedures it sets out where appropriate in a particular case. Your agreement to comply with the guidelines will be deemed agreement to any changes to it.



Bonus TIPS for Successful Posting

Try a Search First
It is highly recommended that a Search be done on your topic before posting, as many questions have been answered in prior posts. As with any search engine, the shorter the search term, the more "hits" will be returned, but the more specific the search term is, the greater the relevance of those "hits". Searching for "table" might well return every message on the board while "tablesum" would greatly restrict the number of messages returned.

When you do post
First, make sure you are posting your question in the correct forum. For example, if you post an issue regarding Desktop applications on the Mobile & Browser Applications board , not only will your question not be seen by the appropriate audience, it may also be removed or relocated.

The more detail you provide about your problem or question, the more likely someone is to understand your request and be able to help. A sample database with a minimum of records (and its support files, zipped together) will make it much easier to diagnose issues with your application. Screen shots of error messages are especially helpful.

When explaining how to reproduce your problem, please be as detailed as possible. Describe every step, click-by-click and keypress-by-keypress. Otherwise when others try to duplicate your problem, they may do something slightly different and end up with different results.

A note about attachments
You may only attach one file to each message. Attachment file size is limited to 2MB. If you need to include several files, you may do so by zipping them into a single archive.

If you forgot to attach your files to your post, please do NOT create a new thread. Instead, reply to your original message and attach the file there.

When attaching screen shots, it is best to attach an image file (.BMP, .JPG, .GIF, .PNG, etc.) or a zip file of several images, as opposed to a Word document containing the screen shots. Because Word documents are prone to viruses, many message board users will not open your Word file, therefore limiting their ability to help you.

Similarly, if you are uploading a zipped archive, you should simply create a .ZIP file and not a self-extracting .EXE as many users will not run your EXE file.
See more
See less

Count/total number of records for userid

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Count/total number of records for userid

    I found a similar post to this but I hope to place the calculated equation in my field rules table.

    My Table (users)

    Userid _____Count___Total
    Flyboy --------1-------3
    Sarass --------1-------4
    Flyboy -------1-------3
    Flyboy -------1-------3
    Sarass -------1-------4
    Sarass -------1-------4
    Grower --------1-------2
    Grower -------1--------2
    Sarass --------1-------4

    My count field has the calculated IF(USERID>"1",1,0). This works fine.
    My total field is where I’m in a quandary.
    I hope to look at the userid and for each occurrence of the userid, add 1 from the Count field.
    Number of times the userid is currently in the table

    Flyboy = 3
    Sarass = 4
    Grower = 2
    Last edited by EricN; 01-20-2008, 06:44 PM.
    Eric

    Alpha Five Websites
    longlivepuppies.com
    socialservicenetwork.com
    -------------------------------------------------
    socialservicenetwork.org

    #2
    Re: Count/total number of records for userid

    Ok, how about this…
    Employers post their jobs on the “posts” table
    Employers registration information in the “users” table

    I want to set a limit (5) on the number of jobs the employer can have posted at any given time.

    In the users table, I have a field called “post_limits” currently set to numeric. When the employer registers, the employer starts out with the number 5 in this field.

    In the posts table, I have a field called, “ad_count” currently set to numeric with a 1 in the field for the ad.

    I would like to be able to subtract a 1 from the post_limits field each time the employer adds a job AND to be able to stop the employer from posting any jobs if the post_limits is 0.

    Spent today researching this but could not find any viable solutions.
    Eric

    Alpha Five Websites
    longlivepuppies.com
    socialservicenetwork.com
    -------------------------------------------------
    socialservicenetwork.org

    Comment


      #3
      Re: Count/total number of records for userid

      Eric,

      I have a membership application, and we have been providing job postings for about 6 months from employers that may interest our members. Here's what we do:

      We have a logical field in the job table named "active", and in order for any job to display, it has to be true.

      So, as employers enter their jobs (we use an on line html editor so they enter them themselves) we send an automatic email to the placement chair. He reviews the job and checks the "active" checkbox if it is appropriate, follows up on missing information, and deletes the "genuine Rolex" watch ads.

      Active jobs appear in the job listing until the expiration date. We set that initially to 30 days, but allow the employer to extend it if necessary. Any change triggers another email.

      We get a count of the total number of jobs and total active jobs for each employer by using dbcount() and display that on the welcome screen as they log in.

      By the way, we also use a character prefix on the id code for the employers of "E" and for applicants of "A". That way it is a simple matter after login to check the first character of ulink and route them to the proper pages.

      Good luck,

      Pat
      Pat Bremkamp
      MindKicks Consulting

      Comment


        #4
        Re: Count/total number of records for userid

        Pat
        Thank you for your response. Many jobs are posted daily and so I want to have this process automatic without any intervention from me.

        I'm looking at the posting method and calculated field rules. Also looking at the events area of a grid.

        In the desktop, I probably would be using the lookup() method in calculated fields somehow. Posting in desktop field rules does not work, correct?

        Thanks
        Eric

        Alpha Five Websites
        longlivepuppies.com
        socialservicenetwork.com
        -------------------------------------------------
        socialservicenetwork.org

        Comment


          #5
          Re: Count/total number of records for userid

          Eric,

          I think Pat was trying to give you the hint of using the dbcount() function. That will very quickly give you the number of items in a table based on your specs so that it then just a matter of a simple "if" statement to redirect if more than 5.

          http://support.alphasoftware.com/alp.../DBCOUNT().htm

          Comment


            #6
            Re: Count/total number of records for userid

            Thanks Doug and Pat
            I will look at dbcount(). Where would I put this if used?

            In the grid? Where in the grid?
            Field rules on desktop level?

            Thanks
            Eric

            Alpha Five Websites
            longlivepuppies.com
            socialservicenetwork.com
            -------------------------------------------------
            socialservicenetwork.org

            Comment


              #7
              Re: Count/total number of records for userid

              I also want the flexibility of allowing a particular client to post more jobs than others when I wish. (Change the posting limits for individual clients). So I'm thinking this count or total would have to be stored in a field and modified (Posted?) from the grid.

              Just stuck on this.
              Eric

              Alpha Five Websites
              longlivepuppies.com
              socialservicenetwork.com
              -------------------------------------------------
              socialservicenetwork.org

              Comment


                #8
                Re: Count/total number of records for userid

                Eric

                I would put the dbcount() in a page between the login and the entry/edit grid. That way, if they have reached their limit, I could redirect them to a page to pay an additional fee to post more jobs or give them the option to delete (inactivate) some jobs that have been filled to make room for additional jobs. I would also have dbcount in a "thank you for posting" page which they would go to after each post. If they have three jobs to post and have already posted 4, then you need to check the count after each entry.

                I would put the job limit in the employer record and look it up in the page after login where you gather all the other employer information from their record. That limit would only have to change if they pay for more jobs (or you give them more) or if their check bounces.

                Pat
                Pat Bremkamp
                MindKicks Consulting

                Comment


                  #9
                  Re: Count/total number of records for userid

                  I was beginning to place code in the beforeinsertrecord event area of the post jobs grid. Where it would check the number balance in the Ads_allowed field in the users database and if the Ads_allowed is still in the positive, user is allowed to post another jobs and at the same time, subtract 1 from the Ads_allowed field.

                  If ads_allowed is 0, then the Result.cancel = .t.
                  Eric

                  Alpha Five Websites
                  longlivepuppies.com
                  socialservicenetwork.com
                  -------------------------------------------------
                  socialservicenetwork.org

                  Comment

                  Working...
                  X