Alpha Video Training
Results 1 to 5 of 5

Thread: Opening a form on the current client.

  1. #1
    Themis Skiathitis
    Guest

    Default Opening a form on the current client.

    Hi all, we have a requirement to open a secondary form whilst performing a transaction. For example, the transaction screen shows the client ID and name but no other info.

    If the client asks a question about their account or usage we go to a more detailed form for the infomation.

    I have used something that was sent to me by someone here to create a popup form when required. The code is as shown below;

    ''XBasic

    dim fp as P
    fp = form.load("Client Data", "popup")
    fp.height = 607
    fp.width = 220
    fp.left = 800
    fp.top = 70
    fp.show()
    fp.activate()

    Question is, what do I need to add to this script to have it open up with the current client details on it?

    I have a popup browse that does exactly this function with the following code;

    DIM layout_ptr as P
    layout_ptr = :Browse.load("Client History")
    layout_ptr:tables:swapdata.filter_expression="CLIENTID = " + CLIENTID0.TEXT
    layout_ptr:tables:swapdata.order_expression=""
    layout_ptr:tables:swapdata.query()
    layout_ptr.show()
    layout_ptr.activate()

    But can't for the life of me come up with something that actually works.

    Any help or advice would be appreciated. Thanks in adavance for any help :)

  2. #2
    Member
    Real Name
    Aaron Strickland
    Join Date
    Jun 2000
    Posts
    30

    Default RE: Opening a form on the current client.

    Themis,

    Create a custom button and attach this script to it. Substitute your information as appropriate.

    DIM layout_ptr as P
    layout_ptr = :Form.load("Name of your Form")
    layout_ptr:tables:YourTableName.filter_expression="CLIENTID = '" + CLIENTID.TEXT + "'"
    layout_ptr:tables:YourTableName.order_expression=""
    layout_ptr:tables:YourTableName.query()
    layout_ptr.show()
    layout_ptr.activate()

  3. #3
    Themis Skiathitis
    Guest

    Default RE: Opening a form on the current client.

    Hi Aaron, I've tried what u suggested but keep getting the following error;

    Trapped Error in Action Command (1)
    Command: Run Script Client Data
    Error: ClientID not found

    Now the script I'm using is as follows;

    ''XBasic

    dim fp as P
    fp = form.load("Client Data", "popup")
    fp:form:Trade Data Form.filter_expression="CLIENTID = '" + CLIENTID.TEXT + "'"
    fp:form:Trade Data Form.order_expression=""
    fp:form:Trade Data Form.query()
    fp.height = 607
    fp.width = 220
    fp.left = 800
    fp.top = 70
    fp.show()
    fp.activate()

    This is attached to a button on the Trade Data Form form and calls another form called Client Data which is the one that is supposed to come up showing the current client.

    Trade Data Form is attached to a db called swapdata while Client Data is attached to the client db. All are part of one set.

    ANy idea what's going wrong? Thanks again for your input.

  4. #4
    "Certified" Alphaholic
    Real Name
    Tom Cone Jr
    Join Date
    Apr 2000
    Location
    Florida
    Posts
    23,311

    Default RE: Opening a form on the current client.

    Themis,

    Study the example I posted in Code Archive Forum.

    'Pass Values Between Forms'

    It shows you 3 different ways to pass field values from one form to another.

    -- tom

  5. #5
    Member
    Real Name
    Brian Dennis
    Join Date
    Sep 2001
    Posts
    372

    Default RE: Opening a form on the current client.

    Themis,
    I am far from being very expert, but I am doing something similar.
    Have you tried using the idea of tabbed forms; the "front" form being the simple form, with more detailed info on other tabs of the form.
    It seems to work for me

    Brian Dennis.

Similar Threads

  1. form margins (difference between client and designer)
    By Sieward in forum Alpha Five Version 7
    Replies: 6
    Last Post: 10-19-2005, 10:06 AM
  2. current filter in a form
    By Melvin Lindberg in forum Alpha Five Version 5
    Replies: 1
    Last Post: 02-10-2004, 02:36 PM
  3. Opening form, not opening to correct record
    By W. Horton in forum Alpha Five Version 4
    Replies: 5
    Last Post: 11-27-2002, 08:52 AM
  4. CURRENT RECORD ONLY ON ONE-TO-MANY SET FORM
    By Mikki Tavernit in forum Alpha Five Version 4
    Replies: 0
    Last Post: 01-10-2002, 10:18 AM
  5. Opening Form on Record Specified from Form
    By Rich Williams in forum Alpha Five Version 4
    Replies: 3
    Last Post: 04-24-2000, 01:50 PM

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
  •