Results 1 to 3 of 3

Thread: Decreasing number in a field

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Aug 2010
    Posts
    137

    Decreasing number in a field

    I am having a program that connects to a database
    Buttons are all disabled until the user logs in
    I want:
    When I press button 1 it decrease 1
    When I press button 2 it decrease 1
    When I press button 3 it decrease 2
    If this field on the database is 0 user can't use the program

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Decreasing number in a field

    Perhaps you could provide a little more information, like what language you're using and what database you're using. Small details but probably important.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3
    Hyperactive Member jasonwucinski's Avatar
    Join Date
    Mar 2010
    Location
    Pittsburgh
    Posts
    452

    Re: Decreasing number in a field

    first off, your question is really vague and shows little effort on your part. That being said, I would first look into table normalization (just google it). you should never store calculated values in a table. instead, you would have several tables. in one of the tables you would store the total number of tries possible. in a second table, you would store each attempt. the tables would have an associated relationship via a foreign key. then, you would do the calculations in your sql select strings.
    if i was able to help, rate my post!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width