Alpha Video Training
Results 1 to 18 of 18

Thread: toggling data entry options

  1. #1
    Member
    Real Name
    Paul Udstrand
    Join Date
    May 2006
    Posts
    6

    Default toggling data entry options

    I have an invoice database that I use for photography. I've been trying to figure out a way to install a toggle in two fields. For instance, in the date field, I'd like it to ask if I want to enter todays date, or not. And I'd like it to ask me if I'm charging sales tax or not. Any idea how I can do this?

    TIA

    Paul.

  2. #2
    "Certified" Alphaholic Mike Wilson's Avatar
    Real Name
    mike wilson
    Join Date
    Apr 2005
    Location
    Grand Rapids, Michigan
    Posts
    4,200

    Default many ways

    Paul,

    It sound like what you need is a Dialog box that opens on the Filed OnArrive event. The dialog box will have two buttons, and the choice of the buttons will drive two separate events.

    See if attached helps.

    Mike W

  3. #3
    VAR davej's Avatar
    Real Name
    Dave Jampole
    Join Date
    Apr 2000
    Location
    Haughton, LA ( just east of Shreveport, Louisiana)
    Posts
    2,524

    Default Creating a 'button' in A4V7 (or 8)

    Paul,

    If A4, we have to write scripts to simulate what you call toggles (as well as scripts for the actions when one of the buttons are clicked) - they can look like a dialog with some number of buttons.

    You'll have to write four keystroke scripts and two dialog scripts. There will be a keystroke script for each action on each of the two dialog scripts.
    For the date field, you would have a dialog script that asks something like 'Entry todays date?' and it would have two choices - 'Yes' and 'No'. If 'Yes' is selected, the appropriate keystroke script will play; if 'No' is selected, the script appropriate for that choice will play. The 'Yes' keystroke script will enter the current days date and skip to the next field; for 'No', the date field would get focus so that you could enter the appropriate date.

    Same logic applies to the sales tax field.

    I have found it easier to write the individual keystroke scripts first and then write the dialog script that calls the appropriate keystroke scripts. You could think of this as bottom-up design.

    Hope this helps.

    Dave
    Dave Jampole
    www.customalpha.com

    Women and cats will do whatever they want. The sooner men and dogs realize that, the happier they will be.


  4. #4
    Member
    Real Name
    Paul Udstrand
    Join Date
    May 2006
    Posts
    6

    Default

    Thanks Mike and Dave. I'll look into writing scripts. I have a couple questions. First, I open the database that Mike sent, and nothing happens when I enter a new record, no boxes pop up. Are they supposed to? In other words, how to I instruct the DB to run the script? Do I load that in the field rules?

    On another note, I feel like a dope, but when I was looking at the sample DB that Mike sent, I opened the options (F2) and noticed that Alt-D will put the date in, it works on my invoice as well so that button is no longer necessary. I just need to get something worked out so I can select whether or not to charge sales tax.

    Thanks,

    Paul.

  5. #5
    VAR davej's Avatar
    Real Name
    Dave Jampole
    Join Date
    Apr 2000
    Location
    Haughton, LA ( just east of Shreveport, Louisiana)
    Posts
    2,524

    Default

    Paul,

    Quote Originally Posted by Paul Udstrand
    ...In other words, how to I instruct the DB to run the script? Do I load that in the field rules?Paul.
    In the field rules for the field - if you want something to happen when you enter the field, you'd use the Enter trigger; to have the action occur when you exit the field, use the Exit trigger. The trigger script is simply a script that triggers (or runs) the script that does the action. It is really simplier than it sounds.

    Dave
    Dave Jampole
    www.customalpha.com

    Women and cats will do whatever they want. The sooner men and dogs realize that, the happier they will be.


  6. #6
    "Certified" Alphaholic Mike Wilson's Avatar
    Real Name
    mike wilson
    Join Date
    Apr 2005
    Location
    Grand Rapids, Michigan
    Posts
    4,200

    Default Push the Button

    Quote Originally Posted by Paul Udstrand
    First, I open the database that Mike sent, and nothing happens when I enter a new record, no boxes pop up. Are they supposed to? In other words, how to I instruct the DB to run the script? Do I load that in the field rules?
    Paul,

    That would be to push the Button marked "Push to Start Sequence".

    Mike W

  7. #7
    Member
    Real Name
    Gary Smith
    Join Date
    Apr 2000
    Posts
    180

    Default

    You may want to add a field to your database called SALESTAX as a 1 character field. The values will be Y or N. If you put a Y in the field, you will calculate the sales tax. If you put a N inthe field, you will not calculate the sales tax. This might be easier than writing scripts.

  8. #8
    Member
    Real Name
    Paul Udstrand
    Join Date
    May 2006
    Posts
    6

    Default

    Quote Originally Posted by Mike Wilson
    Paul,

    That would be to push the Button marked "Push to Start Sequence".

    Mike W
    I don't see any "push to start sequence" buttons. Let me go back, I'm using alpha 4, version 7. one of the DB files you sent is an alpha 5 database. Now I also have alpha 5 version 4.5, but when I open the buttons DB or Buttonnames DB in A5, I don't see any buttons there either.

    Sorry if I'm being dense about this.

    Paul.

  9. #9
    "Certified" Alphaholic Mike Wilson's Avatar
    Real Name
    mike wilson
    Join Date
    Apr 2005
    Location
    Grand Rapids, Michigan
    Posts
    4,200

    Default Version

    Paul,

    The example I sent is A5v7. It might be that is what the issue is. I downloaded the zip and checked it on my end and is seems complete. Maybe someone else with A5v5 or higher can check it.

    Mike W

  10. #10
    VAR davej's Avatar
    Real Name
    Dave Jampole
    Join Date
    Apr 2000
    Location
    Haughton, LA ( just east of Shreveport, Louisiana)
    Posts
    2,524

    Default

    Mike,

    Paul is running Alpha 4 V7, so a proposed solution for ANY version of Alpha Five would not be relevant.

    Dave
    Dave Jampole
    www.customalpha.com

    Women and cats will do whatever they want. The sooner men and dogs realize that, the happier they will be.


  11. #11
    "Certified" Alphaholic Mike Wilson's Avatar
    Real Name
    mike wilson
    Join Date
    Apr 2005
    Location
    Grand Rapids, Michigan
    Posts
    4,200

    Default

    Quote Originally Posted by davej
    Mike,

    Paul is running Alpha 4 V7, so a proposed solution for ANY version of Alpha Five would not be relevant.

    Dave
    Dave,
    Thanks for the heads up. For my sake, could you please let me know how you came to the knowledge this was the case so i might in the future be aware of such and hheed to efforts of talking Greek to a China man?

    Mike W

  12. #12
    VAR davej's Avatar
    Real Name
    Dave Jampole
    Join Date
    Apr 2000
    Location
    Haughton, LA ( just east of Shreveport, Louisiana)
    Posts
    2,524

    Default Toggling data entry options

    Mike,

    The forum under which the question is asked is a good hint - although not foolproof. Paul also uses a few Alpha Four specific terms - 'db' and 'script' - again that's not foolproof; it is easy to mix A4 terminology when talking about A5 and vice versa.

    And your concern about talking Greek to a China man is a concern we would all be well advised to heed. It is natural to phrase what we offer to others in terms that are relevant to us. A thought to keep in mind is something I read in one of the textbooks I taught from - 'if the only tool you have in yuour toolbox is a hammer, all the problems you face look like nails'. Kinda' cryptic, but a good thought to remember.

    Dave

    P.S. Keep offering help on the messageboard - it is, in my opinion, one of the strongest points about Alpha.
    Dave Jampole
    www.customalpha.com

    Women and cats will do whatever they want. The sooner men and dogs realize that, the happier they will be.


  13. #13
    Member
    Real Name
    Paul Udstrand
    Join Date
    May 2006
    Posts
    6

    Default

    Quote Originally Posted by Gary Smith
    You may want to add a field to your database called SALESTAX as a 1 character field. The values will be Y or N. If you put a Y in the field, you will calculate the sales tax. If you put a N inthe field, you will not calculate the sales tax. This might be easier than writing scripts.
    Gary,

    This is an interesting idea, I had considered it but couldn't figure out how to make it work. How do I set up one field, the "tax" field, so that it doesn't calculate unless another field ( the salestax field) authorizes it? How do I link these fields?

    Dave,

    The exit/enter trigger options are not available to put the scripts in because this is a calculated field not a user entered field. It's calculated because it takes a sub total and calculates a .065 sales tax. The sales tax and sub total are then added in a Total field. Maybe what I need to do is focus on the total field and not the tax field. Maybe I can take Gary's idea and figure out a way to tell the "total" when and when not to add the sales tax.

    In the meantime my quick and dirty fix has been to copy the database and simply delete the tax field, so now I have two invoice databases, one for taxed transactions and one for not tax transactions.

    There's got to be a way to make this work though. Thanks for all your help, I'll look through my manuals and see if I can figure the details of how to make some of these suggestions work.

    Paul.

  14. #14
    VAR davej's Avatar
    Real Name
    Dave Jampole
    Join Date
    Apr 2000
    Location
    Haughton, LA ( just east of Shreveport, Louisiana)
    Posts
    2,524

    Default

    Paul,

    You can put the script in the Exit trigger of the field just prior to the sales tax field. If the response is 'Yes', set the tax rate at its normal rate; if the response is 'No' set the tax rate at '0'. That way, the calculation always occurs, but with a rate of 0, there is effectively no tax accessed.

    Dave
    Dave Jampole
    www.customalpha.com

    Women and cats will do whatever they want. The sooner men and dogs realize that, the happier they will be.


  15. #15
    Member
    Real Name
    Paul Udstrand
    Join Date
    May 2006
    Posts
    6

    Default

    Quote Originally Posted by davej
    Paul,

    You can put the script in the Exit trigger of the field just prior to the sales tax field. If the response is 'Yes', set the tax rate at its normal rate; if the response is 'No' set the tax rate at '0'. That way, the calculation always occurs, but with a rate of 0, there is effectively no tax accessed.

    Dave
    Sweet. Now all I have to do is figure what this script you speak of should be and I'll be on my way.

    Thanks.

    Paul.

  16. #16
    VAR davej's Avatar
    Real Name
    Dave Jampole
    Join Date
    Apr 2000
    Location
    Haughton, LA ( just east of Shreveport, Louisiana)
    Posts
    2,524

    Default

    Paul,

    Send me the name of the database and the tax rate field and I'll write the scripts for you.

    Dave
    Dave Jampole
    www.customalpha.com

    Women and cats will do whatever they want. The sooner men and dogs realize that, the happier they will be.


  17. #17
    Member
    Real Name
    Paul Udstrand
    Join Date
    May 2006
    Posts
    6

    Default

    Quote Originally Posted by davej
    Paul,

    Send me the name of the database and the tax rate field and I'll write the scripts for you.

    Dave
    Wow, thanks. The database is: PHOTOINV The tax field is: TAX

    Thanks again,

    Paul.

  18. #18
    VAR davej's Avatar
    Real Name
    Dave Jampole
    Join Date
    Apr 2000
    Location
    Haughton, LA ( just east of Shreveport, Louisiana)
    Posts
    2,524

    Default

    Paul,

    Send an email to me at: dave@customalpha.com and I'll send the three scripts to you along with instructions on how to edit them.

    Dave

    P.S. Where are you located? If we are close, we can talk, which is somewhat quicker than trading emails or messageboard posts.
    Dave Jampole
    www.customalpha.com

    Women and cats will do whatever they want. The sooner men and dogs realize that, the happier they will be.


Similar Threads

  1. Options for pulling data *FROM* A5V6? ODBC? ADO?
    By mbmonk in forum Alpha Five Version 6
    Replies: 2
    Last Post: 12-21-2005, 12:21 PM
  2. Toggling forms as dialogs
    By Jim Stermer in forum Alpha Five Version 5
    Replies: 1
    Last Post: 01-18-2003, 11:59 AM

Bookmarks

Posting Permissions

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