Alpha Video Training
Results 1 to 2 of 2

Thread: Need help with a print button script.

  1. #1
    George BVI
    Guest

    Default Need help with a print button script.

    I have a from that has a button to print the current record. I would like to place a conditional object that would display a red box if not printed and green box if the record was printed.

    I have tried using a logical field to flag if printed or not. In the print buttons script after the print routine I put in these two lines
    twostbtn9.value=.T. 'so that the print flag field is set to .T.
    twostbtn9.refresh()

    This works if for the twostbtn9 button, the button is display as been pressed, but the conditional object is not change to green unless I press the button off and back on again. I have set the conditional so that if print flag field = .F. or .T..

    Also, I don't really need the twostbtn9, I just don't know have else to get this to work.

    Any ideas? Thanks

  2. #2
    "Certified" Alphaholic
    Real Name
    William Hanigsberg
    Join Date
    Apr 2000
    Location
    Toronto, ON
    Posts
    4,018

    Default RE: Need help with a print button script.

    George:

    I agree that you can probably forget the button. In form design declare a shared variable of type logical.

    Instead of setting the button's value to true with your code
    (twostbtn9.value=.T.)
    set the value of the variable
    your_variable's_name=.T.

    Remember that your script must also declare the variable as shared.

    Finally, using the same syntax as you employed on the button refresh the conditional object so it responds to the change in the variable's value.

    Even with your current code, pressing F5 to refresh the form will probably change the conditional object to correctly reflect the variable.

    Bill

Similar Threads

  1. Is it psoosible to write a script 2 print a script
    By Graham Wickens in forum Alpha Five Version 4
    Replies: 2
    Last Post: 11-03-2002, 01:27 PM
  2. Using a button to print
    By David Darby in forum Alpha Five Version 4
    Replies: 4
    Last Post: 10-14-2002, 07:42 AM
  3. Button to Print a Report?
    By Bob Elliott in forum Alpha Five Version 4
    Replies: 1
    Last Post: 05-24-2002, 05:28 AM
  4. Print dialog box interrupts multi-print script
    By Matthew Wilson in forum Alpha Five Version 4
    Replies: 0
    Last Post: 04-26-2002, 07:37 AM
  5. Using One Button to Query and Print
    By Rodney Efird in forum Alpha Five Version 4
    Replies: 6
    Last Post: 12-20-2000, 04:26 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
  •