Page Index Toggle Pages: 1 2 [3] 4 5  Send Topic Send Topic Print Print
Very Hot Topic (More than 25 Replies) UserSelect Question (Read 12530 times)
Bharat_Naik
Senior Member
Members
*****
Offline


Ever ready to learn and
share

Posts: 1202
Location: Chicago,  Illinois
Joined: Dec 16th, 2003
Re: UserSelect Question
Reply #30 - Mar 27th, 2005 at 4:30am
Print Post Print Post  
You are trying to get the list from subform and ParentForm has the key. You will have to get info in the subform. For that you will have to make one more element that takes the key value from the parentform, hide that element, so it does not take the realestate of the subform.

Intially you can mass update but later on for new as well as updated form, it should automatically take the key value into the subform.

Once you have the key value in subform, the rest should be easy.
  
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: UserSelect Question
Reply #31 - Mar 27th, 2005 at 7:37am
Print Post Print Post  
Does your subform has Natural link or relational link?
  
Back to top
 
IP Logged
 
FlipGilbert
Full Member
***
Offline


Running Ver 2.6.4

Posts: 236
Location: Sandy Eggo
Joined: Mar 8th, 2005
Re: UserSelect Question
Reply #32 - Mar 27th, 2005 at 6:14pm
Print Post Print Post  
had to look that one up, Its natural linking.
  

It's not what a man says that matters or how he says it, but what he does and how he does it.
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: UserSelect Question
Reply #33 - Mar 27th, 2005 at 6:58pm
Print Post Print Post  
That should be ok. I was thinking about the mass-updating the data in the subform.  If it was relational link, you will have already key field in place. Since you have natural link, you will have to make a field and mass update if link is not already in place.
  
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: UserSelect Question
Reply #34 - Mar 28th, 2005 at 4:36am
Print Post Print Post  
I have done some work in sample database, Countries, that is a typical database with subform named "Cities". I created on element in subform named "Country"  and updated its value from ParentForm "Countries".  I used following Code for Mass Updating

Code
Select All
var vName as String
var i as Int


For i = 1 to @FormResultSetTotal("Cities")
	FormFieldValue ("Cities", "Country", i, @FormFieldValue("Countries", "Country", @FormResultSetCurrentPosition("Countries")))

Next


 



It produced the desired result. Now subform have "Country" element which proper country.

I made one other form named Display, which has just two elements namely - Country and City.

I can get the x-family work on the parent form, say getting the name of the Country from the parent form, but using the x-family commands on subform elements and layouts failed miserably. The following command in Display layout did not yield anything...

Code
Select All
vString2 = @xlookupall (@FN, Country, "Cities!Country", "City")
writeln (vstring2)


PopulateListElement( City, vString2)
 




or

Code
Select All
var vString2 as String



vString2 = @XLookupSourceList(@FN, Country, "Cities!Country", "City")

PopulateListElement( City, vString2)

 



Attempt is to narrow down the list of the cities having already key is being established in subform. I have not been successful so far.  That leads me to ask, do these commands (x-family) works to get the data from subform, or it needs to have the form at the same level?
  
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: UserSelect Question
Reply #35 - Mar 28th, 2005 at 4:05pm
Print Post Print Post  
Never mind. Above works perfect.
  
Back to top
 
IP Logged
 
FlipGilbert
Full Member
***
Offline


Running Ver 2.6.4

Posts: 236
Location: Sandy Eggo
Joined: Mar 8th, 2005
Re: UserSelect Question
Reply #36 - Mar 28th, 2005 at 6:43pm
Print Post Print Post  
I have this programed in (ON ELEMENT EXIT)  on what I have as the  DISPATCH form or your display form.

var vString2 as String



vString2 = @XLookupSourceList(@FN, Company name, "equipment list!co_name", "Equipment type")

PopulateListElement( machine type, vString2)

with no errors but aslo with no results. I did a manual update on the equipment list as its so small at the moment
  

It's not what a man says that matters or how he says it, but what he does and how he does it.
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: UserSelect Question
Reply #37 - Mar 28th, 2005 at 7:43pm
Print Post Print Post  
FlipGilbert,
Please send me your e-mail address so I can send you the sample application countries1.db (modified countries.db which comes as a sample application with Sesame).  I guess this will make understanding clear about how it works.

Bharat
  
Back to top
 
IP Logged
 
FlipGilbert
Full Member
***
Offline


Running Ver 2.6.4

Posts: 236
Location: Sandy Eggo
Joined: Mar 8th, 2005
Re: UserSelect Question
Reply #38 - Mar 28th, 2005 at 8:24pm
Print Post Print Post  
Thanks Bharat , e-mail sent
  

It's not what a man says that matters or how he says it, but what he does and how he does it.
Back to top
 
IP Logged
 
FlipGilbert
Full Member
***
Offline


Running Ver 2.6.4

Posts: 236
Location: Sandy Eggo
Joined: Mar 8th, 2005
Re: UserSelect Question
Reply #39 - Mar 28th, 2005 at 10:03pm
Print Post Print Post  
wow, thats nice. its going to take some time for me to absorb that. thank you for example.
  

It's not what a man says that matters or how he says it, but what he does and how he does it.
Back to top
 
IP Logged
 
FlipGilbert
Full Member
***
Offline


Running Ver 2.6.4

Posts: 236
Location: Sandy Eggo
Joined: Mar 8th, 2005
Re: UserSelect Question
Reply #40 - Mar 29th, 2005 at 12:39am
Print Post Print Post  
The userslect works well, but I would like it to auto type other fields from the same to LEs on the main form that would be like xlookup filename(newdispatch), key(company name), form name(equipment list)!ext key(company name), a second key field (equipment type) then target. 
and then i want it to guess the winning lotery numbers. well maybe not that the lotery ticket thing. am i asking too much?
its so I can pick out a piece of equipment on the dispatch form and it fills in the model and serial number. the more I study the more it says no or least not with a lookup that im used to.  I have the natural links or could it be done in relative links instead?
Thanks always
  

It's not what a man says that matters or how he says it, but what he does and how he does it.
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: UserSelect Question
Reply #41 - Mar 29th, 2005 at 3:20am
Print Post Print Post  
Quote:
I would like it to auto type other fields from the same to LEs on the main form that would be like xlookup filename(newdispatch), key(company name), form name(equipment list)!ext key(company name), a second key field (equipment type) then target.


Once you have got the key in the form with Userselect, or Popupmenu or Combobox, getting other fields to be filled out should be easy.

On Element Exit Event, write multiple @lookups if you are getting value from different forms, or use @XLookupsourcelist  if you are getting all the values from the same forms.

Target1 = @xlookup (filename, key, "form!ext.key", "Source")

Target2 = @xlookup (filename, key, "form!ext.key", "Source")

Target3 = @xlookup (filename, key, "form!ext.key", "Source")

On and on....

If you are getting values from same form then


var vReturnval as string
var str1 as string
var str2 as string
var str3 as string
vReturnval = @XLookupsourcelist (Filename, key, "Form!ext.key", "source1;source2;Sourc3") 
str1 = @AccessStringArray(vReturnval, 1)
str2 = @accessStringArray(vReturnval, 2)
str3 = @accessStringArray(vReturnval, 3)
Target1 = str1
Target2 = str2
Target3 = str3

Quote:
I have the natural links or could it be done in relative links instead?


Once you get the key value in the form you are filling out, that should not make any difference.

FlipGilbert, did I understand right as what are you trying to do? or I am off the target!!!
  
Back to top
 
IP Logged
 
FlipGilbert
Full Member
***
Offline


Running Ver 2.6.4

Posts: 236
Location: Sandy Eggo
Joined: Mar 8th, 2005
Re: UserSelect Question
Reply #42 - Mar 29th, 2005 at 4:15am
Print Post Print Post  
No, I think your on target. its me having difficulty understanding. When you put it like you just did it makes a little more sense. Im going to try this. You are being more than helpful.
  

It's not what a man says that matters or how he says it, but what he does and how he does it.
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: UserSelect Question
Reply #43 - Mar 29th, 2005 at 4:25am
Print Post Print Post  
When you select the key, be careful, the external file should have one to one relationship, else it will give you the value of the first match and that is not what you wanted.

To make this point stick, let us take example of the display form in Countries1.db.   If you want to get population value from "Cities" form in the display form, key must be "City".  If you use "Country" as a key, many cities are in one country and hence you will get the value of the first match of the country.. and that is not you want. Key might be different for different value you need to have from different forms.
  
Back to top
 
IP Logged
 
FlipGilbert
Full Member
***
Offline


Running Ver 2.6.4

Posts: 236
Location: Sandy Eggo
Joined: Mar 8th, 2005
Re: UserSelect Question
Reply #44 - Mar 30th, 2005 at 11:19pm
Print Post Print Post  
Bharat
After studying the code you sent, I now have more questions than answers.  I will use the name of the db you sent me to keep it simple.

Im using a converted Q&A database and in the DISPLAY form it has a text field for the COUNTRY form element not a combo box. I will type in the country in manually or more accurately it will be filled in already by the time I get to the CITY form element.

I would like a userselect for the CITY form element, thats also a text field, that I can choose to fill in the CITY form element and automatically fill in the POPULATION form element on the DISPLAY form.

Do I need to change over to combo boxes? Thanks for your help
  

It's not what a man says that matters or how he says it, but what he does and how he does it.
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1 2 [3] 4 5 
Send Topic Send Topic Print Print