Normal Topic SDesigner (Read 1067 times)
NetMinder
Member
*
Offline


No personal text

Posts: 2
Joined: Jan 16th, 2004
SDesigner
Jan 16th, 2004 at 8:52pm
Print Post Print Post  
Ok.

     After numerous attempts at getting Q&A Exported, and Translated into a Sesame .db file, and getting the form to look the way it needs to look, I have three very small issues.

1. The "Order Date" field in the Sesame Database does not Auto fill with the current Date.

2. The "Reference" field in the Sesame Database does not allow for typing an input, but that's good.  But it also doesn't automatically give me the next sequencial number, as it needs to.

3. I have the form the way I need it, but everything is really close together.  I need to find a way to make the form larger, so I can spread my fields out, to make the form more easily readable.
  
Back to top
 
IP Logged
 
BOBSCOTT
Senior Member
Members
*****
Offline


That Darn Computer #$X#
{curse words}

Posts: 1195
Joined: Nov 22nd, 2002
Re: SDesigner
Reply #1 - Jan 16th, 2004 at 10:52pm
Print Post Print Post  
NetMinder,

Here are some examples of how I accomplished these tasks. You will need to replace the element names I used for yours

Quote:
1. The "Order Date" field in the Sesame Database does not Auto fill with the current Date.

You will need to add Sbasic commands to the element order date. The example below might be a start. This works for me.

// This enters Todays Date if record is @new

If @isnew and Dateentered = "" then

    dateentered = @date
}

Quote:
2. The "Reference" field in the Sesame Database does not allow for typing an input, but that's good.  But it also doesn't automatically give me the next sequencial number, as it needs to.


This example is what I use


/*
This says that if I am adding a record that is new to the database and the
patientid is empty that the patientid will be the globalvalue NextCustRecNo plus
1 and then it is updating the globalvalue so it will be available with the
correct number when it is needed next.
*/



var GSNextCustRecNo as int



  If @isnew and PatientID = "" then { 
    PatientID = @ToNumber(@GlobalValue("NextCustRecNo")) + 1 
    GlobalValue("NextCustRecNo", @Str(PatientId)) 
}   

Quote:
3. I have the form the way I need it, but everything is really close together.  I need to find a way to make the form larger, so I can spread my fields out, to make the form more easily readable.

There are numerous ways to accomplish this. One way is:

Select an area on the layout canvas that does not have an element and click
Go to property editor and click the tab labeled position
Enter numbers in height click arrow
Enter Numbers in width click arrow

You might want to read some of the earlier posts. Some of this stuff is explained in a little more detail.

Happy coding.  Wink

  

Team – Together Everyone Achieves More
Back to top
 
IP Logged
 
NetMinder
Member
*
Offline


No personal text

Posts: 2
Joined: Jan 16th, 2004
Re: SDesigner
Reply #2 - Jan 17th, 2004 at 1:00am
Print Post Print Post  
Ok, This is the Code that I've added, and it does appear to be working, but the small problem is that we are exporting a data base from Q&A.  The Reference numbers from this database are as they should be, but any new records start out with Reference #1.  Is there a way that I can assign a starting number?

If Reference = "" then {   
    Reference = @ToNumber(@GlobalValue("NextCustRecNo")) + 1   
    GlobalValue("NextCustRecNo", @Str(Reference))   
}
  
Back to top
 
IP Logged
 
Bharat_Naik
Senior Member
Members
*****
Offline


Ever ready to learn and
share

Posts: 1202
Location: Chicago,  Illinois
Joined: Dec 16th, 2003
Re: SDesigner
Reply #3 - Jan 17th, 2004 at 2:17am
Print Post Print Post  
I am pasteing here note from earlier discussion. I believe this answer your question.

Every time you want to use the global value NextCustRecNo you don't have to go back in and change your code to another number. Sesame will remember the last value of NextCustRecNo even if you close sesame, shut down the computer and bring it back up. So the only code you need to put in the field entry event is

If @IsNew and PatientID = "" then {   
    PatientID = @ToNumber(@GlobalValue("NextCustRecNo")) + 1   
    GlobalValue("NextCustRecNo", @Str(PatientId))   
}   

What I would do to iniatilize the global value for the first time, say you already have 510 records imported from QA, just type the following code in a mass update spec

    GlobalValue("NextCustRecNo", @Str(510))   

Click Run, Click Interactive, Click Update, Click Cancel. Then the next time you add a record it will be Patient id #511, and it is important to remember that global values are stored as strings.
  
Back to top
 
IP Logged
 
TJCajun
Junior Member
**
Offline


"Laissez les bons temps
rouler"

Posts: 72
Location: Louisiana
Joined: Nov 25th, 2002
Re: SDesigner
Reply #4 - Jan 18th, 2004 at 1:58am
Print Post Print Post  
Quote:
Ok.

3. I have the form the way I need it, but everything is really close together.  I need to find a way to make the form larger, so I can spread my fields out, to make the form more easily readable.


Please consider subscribing to Inside Sesame! (www.insidesesame.com) ; If you liked The Quick Answer newsletter for Q&A, you will like Inside Sesame.  The first issue, Jan 2004 contained an article by Gordon Meigs on how to take a translated Q&A database and make it look better (change colors, spread the fields out like what you need to do) and more!

A year's subscription is $109, I think.  That's a few cents over $9 a month.  For that price, if you save an hour's worth of time by using just one thing from each month's issue, it's paid for itself.  With Sesame being brand new, I bet every issue will have much more than 1 tip or helpful article that everyone will be able to use.

T.J.
  
Back to top
IP Logged