Page Index Toggle Pages: [1] 2 3  Send Topic Send Topic Print Print
Very Hot Topic (More than 25 Replies) Selection box (Read 7092 times)
billgordon
Junior Member
**
Offline


No personal text

Posts: 61
Joined: Dec 31st, 2003
Selection box
Jan 26th, 2004 at 8:02pm
Print Post Print Post  
My database is named Myfirst.db
I have 2 databases in Myfirst.db 1 called Purchase and 1 called vendors
The forms are named Purchase and Vendors
The database vendors has a field called Vendorname that has all of the vendors names in it.

I would like to have a selection list built from that data called from the purchase database.

What is the recommended method?  Xuserselect or @popupmenu or ?
  
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: Selection box
Reply #1 - Jan 26th, 2004 at 8:51pm
Print Post Print Post  
@PopUpMenu with @xListvalues gives you the list you need and xuserselect command will do the same. However, if your vendor list is very long, I personally like the @xuserselectr which can narrow down the list. Ofcourse it requires a little coding but works great to narrow down your choice.

If you place Bl.. entry in the element, it will give you list of every vendor begins with "Bl  " only.

The topic was discussed in the following link....

http://www.lantica.com/Forum2/cgi-bin/yabb/YaBB.pl?board=gen_disc;action=display...
  
Back to top
 
IP Logged
 
billgordon
Junior Member
**
Offline


No personal text

Posts: 61
Joined: Dec 31st, 2003
Re: Selection box
Reply #2 - Jan 26th, 2004 at 9:16pm
Print Post Print Post  
Quote:


Were are you using XUserselectR  in this ? can you please dumb this down a little for me. This is a big bite I am trying to take. I am new to this.

vStart as string
vFieldName as string
vEnd as string 


If @in (vFieldName, "..")  > 0 then

    vStart = @left (vFieldName, @in (vFieldName, "..") - 1) + @chr(1)
    vEnd = @left (vFieldName,   @in (vFieldName, "..") - 1) + "zzzzzzz"
}
  
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: Selection box
Reply #3 - Jan 26th, 2004 at 9:24pm
Print Post Print Post  
I will place the whole code, but for better understanding first read the Programming Manual Page 133 and Page 134.  The text you quoted deals only with "start" and "end" part of the xuserselectr command.
  
Back to top
 
IP Logged
 
billgordon
Junior Member
**
Offline


No personal text

Posts: 61
Joined: Dec 31st, 2003
Re: Selection box
Reply #4 - Jan 26th, 2004 at 10:03pm
Print Post Print Post  
I thought I would simplify this try with set start and end. But I still have got it wrong.

My database is named Myfirst.db
I have 2 databases in Myfirst.db 1 called Purchase and 1 called vendors
The forms are named Purchase and Vendors
The database vendors has a field called Vendorname that has all of the vendors names in it.
The database purchase has a field called purchasefrom

   XUserselectr(
My filename C:\Sesame\Data\myfirst.db,
My ext selection element  vendors!vendors
Source element vendorname
Start A
End  Z
Target Purchase from

The final statement reads

   XUserselectr(“C:\Sesame\Data\myfirst.db”, “vendors!vendors”, “vendorname”, “A”,” Z”, “ Purchasefrom”)
  
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: Selection box
Reply #5 - Jan 26th, 2004 at 10:15pm
Print Post Print Post  
The following code goes in Global Code

stat vFieldName as String
stat vStart as String
stat vEnd as String

Subroutine PickList_choose( )

vStart = @left (vFieldName, @in (vFieldName, "..") - 1) + @chr (1)
vEnd = @left (vFieldName,   @in (vFieldName, "..") - 1) + "zzzzzzz"
End Subroutine

Place this in your VendorName Element on element exit event.  I have adjusted it to the name of your element and database name.

if @in(VendorName, "..") > 0 then

     {
           vFieldName = VendorName
           picklist_choose ( )
           
           VendorName = @xUserselectR (@filename, "Vendors!VendorName", "VendorName", vStart, vEnd)

     }



  If the form name is not exactly matching or the element name is not matching, you might have to change it.  Please let me know if this works.  If you need to have Names of all vendors just place ".." in the field.
  
Back to top
 
IP Logged
 
billgordon
Junior Member
**
Offline


No personal text

Posts: 61
Joined: Dec 31st, 2003
Re: Selection box
Reply #6 - Jan 26th, 2004 at 11:09pm
Print Post Print Post  
Thank you for your kindness in helping.

The database takes the code without error upon test. But nothing happens when exiting field.

Could I impose on you farther and ask if  you possibly can annotate your programming step by step as to what is happening so I can follow along closer

Thank you
  
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: Selection box
Reply #7 - Jan 26th, 2004 at 11:27pm
Print Post Print Post  
I believe you are trying to test the code in the preview mode of Sdesigner.  It would not work there as x-family commands and functions would not work in preview. You want to reconcile with database and then test it.

Please let me know if it works or still does not work that way.
  
Back to top
 
IP Logged
 
BOBSCOTT
Senior Member
Members
*****
Offline


That Darn Computer #$X#
{curse words}

Posts: 1195
Joined: Nov 22nd, 2002
Re: Selection box
Reply #8 - Jan 26th, 2004 at 11:40pm
Print Post Print Post  
Bill,
how about backing up for a moment and just use a simple XUserselectR  Syntax without anything fancy just to be sure you are accessing the external database.

For the purpose of  clarification  see if your syntax matches the books explanation as Bharat pointed out on pages 133 and 134.

I know sometimes the manual gets overwhelming so I have tried below in plain speak to explain what  I believe the Syntax of the basic XUserselectR is:

Filename = the full path of db file

FormName!ext selection element = form name plus ! sign and the name of the element from the external database that you want to display data from.


Source element = the field from the external database that will be returned when the above is selected.

Start = starting range

End = ending range

Target element = the element the data will be put in.


(Bharat,

This makes me think if the target  is on a subform does the subform name or main form name need to be added?)

Once you have your XUserselectR working with just the start and end stated as in the example on pg 134 , We can then get fancier and follow Bharats lead.

Keep plugging away at it, You will eventually get it working.

Robert
  

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


No personal text

Posts: 61
Joined: Dec 31st, 2003
Re: Selection box
Reply #9 - Jan 26th, 2004 at 11:45pm
Print Post Print Post  
Quote:
I believe you are trying to test the code in the preview mode of Sdesigner.  It would not work there as x-family commands and functions would not work in preview. You want to reconcile with database and then test it.

Please let me know if it works or still does not work that way.


No I am not using preview. I am using a reconciled version.
  
Back to top
 
IP Logged
 
billgordon
Junior Member
**
Offline


No personal text

Posts: 61
Joined: Dec 31st, 2003
Re: Selection box
Reply #10 - Jan 27th, 2004 at 12:08am
Print Post Print Post  
Bob I really like the simple way you explained the command thank you. Your simple English is easier for me to understand then the manual. However  I am sorry to say it still does not work for me.
  
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: Selection box
Reply #11 - Jan 27th, 2004 at 12:57am
Print Post Print Post  
The following code goes in Global Code  

stat vFieldName as String
stat vStart as String
stat vEnd as String

Subroutine PickList_choose( )

vStart = @left (vFieldName, @in (vFieldName, "..") - 1) + @chr (1)
vEnd = @left (vFieldName,   @in (vFieldName, "..") - 1) + "zzzzzzz"
End Subroutine

Place this in your PurchaseFrom Element on element exit event of PurchaseFrom element.  I have adjusted it to the name of your element and database name.

if @in(VendorName, "..") > 0 then  

{
 vFieldName = PurchaseFrom
 picklist_choose ( )
 
 PurchaseFrom = @xUserselectR (@filename, "Vendors!VendorName", "VendorName", vStart, vEnd)

}

Bill, after reading your database specification that I did not read earlier, I had to make changes at two places. I think your earlier posting and my post got crossed, so did not get to read your note. I think this should work. If it does not, I will work with you till it does.


  
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: Selection box
Reply #12 - Jan 27th, 2004 at 1:04am
Print Post Print Post  
Quote:
Bharat, 

This makes me think if the target  is on a subform does the subform name or main form name need to be added?)

Once you have your XUserselectR working with just the start and end stated as in the example on pg 134 , We can then get fancier and follow Bharats lead.

Keep plugging away at it, You will eventually get it working.




Bob, I have not started working with subform yet. So, do not have exact answer but it works very well on the main form.  I think this is the way to go if the list is very long, just like Diagnosis or Medicine in Medical Record making program. Where do you have so much use of subform?  Just wondering....
  
Back to top
 
IP Logged
 
BOBSCOTT
Senior Member
Members
*****
Offline


That Darn Computer #$X#
{curse words}

Posts: 1195
Joined: Nov 22nd, 2002
Re: Selection box
Reply #13 - Jan 27th, 2004 at 1:49am
Print Post Print Post  
Quote:
  Where do you have so much use of subform?  Just wondering....


Bharat,

The more I use them the more uses I find for them. Imagine in your  case the top of your main screen is your generic patient info then you have a subform on the right side that has your patient scheduleing system. Then the rest of your screen has tabs. 1 tab has a tableview subform of all of the previous visits that patient has had. Another tab has a subform to all the billing dates amounts and codes for that patient. You can have subforms that tracks all the meds and scripts you have written. When you select a patient all the data is called from all the separate databases and instantly viewable on 1 form. Using Sesames visibility feature you can make elements appear or disappear based on the user. This will keep you Hippa compliant. If you scan all your E.O.Bs  Imagine your collectors or billing person being able to see each one per activity. I have my test app using checkboxes to go out to a specific directory and placing a check in a box if a document {in your case  say insurance card }is available to view. Think of how much better your compliance can be if you had a checkbox for every paper you needed to have like Ins cards, Hippa release, superbill etc. and if the image was in the system you would know by the checkbox if anything was missing. Either your staff would see it or run a report weekly and work the problem files. I could go on for days but you probably get the jist. Smiley

The advantage of the subforms are you can have unlimited amount of events such as co payments a patient owes you 100.00 but he pays 10.00 a month you can just keep adding you never run out of fields. And using Sbasic yo have an element that calculates all billing owed minus each payment and you instantly know how much is owed on a patient by patient basis. But if you need to have an aging you can run it on the separate database and get a true aging based in line items. (I can go on for ever)

Give em a good try but be careful like Sesame Subforms are addicting!
  

Team – Together Everyone Achieves More
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: Selection box
Reply #14 - Jan 27th, 2004 at 3:34am
Print Post Print Post  
Bob, very interesting. I will have to start experimenting with it. It's indeed an eye opener as to what can be done with Sesame. Thank you very much for taking time to show me the possibilities.

The problem is when you have something working good, it is hard to put in substantial efforts. Just trying to convert a few databases and trying to see how everything is going to workout. I Like Sesame a lot. It has a lot to offer. See a lot of possibilities, however, cannot see putting up everything together and achieiving the same level of automization as with Q&A. With Q&A macro, just a single key to complete the most simplest operation to as complicated as preparing elctronic billing file, dumping it to bulletin board, get the file of the report, allocate them and posting them to respective records.....   and all these with one key (nested macros), and on the top of it,  you make macro stop at several places to accept input of data such as dates for record selections etc.  Custom Menu System makes it more user friendly and easy to train new employees.

Having said that, I believe, the developers have envisioned bigger and better plan. This is just a version 1.0. It is very impressive indeed. All that can be done in Q&A, one can accomplish that in Sesame using programming codes.  I only hope to learn them fast and use them.  Compared to codes, keys recording macro is little archaic, inefficient and error-prone.

Well, I have spent 14 years with Q&A to get where I am with my system. I hope to get a lot further with Sesame in considerable less time.

  
Back to top
 
IP Logged
 
Page Index Toggle Pages: [1] 2 3 
Send Topic Send Topic Print Print