Submitted by srv181 on 2009/02/08 10:52
Is there some way to populate the content of a popup list for a field with values from another grid?
Access has a function to do this (I believe it is called dblookup - or so).
 
I need to assign tasks to contacts. I know that one could use the parent/hierarchy functionality but that is too tedious - just too many steps to go through. It would be so much simpler to be able to populate the content of the popup with some field from another grid.
 
Is anyone doing something like this?
 
Thanks

Comments

Apologies if you've read this already - I've completely edited it now!

Do you mean e.g. you would like all your contact names to show in the drop-down list? 
  • 26-31 Pop-up list: Enter the list of values, | separated. If Auto-list is checked, the list is automatically generated based on values in the field. see Auto-list
simply paste your list in that box - #27 on that page ( | separated) and DONT select Auto-list and it will work
e.g.
CompanyA|CompanyD|CompanyE|CompanyK
 
Dont know of any way of making this easier to do - copy your contact name field-cells  and use some software with find & replace to change whatever seperates the lines (return?) to "|"
Or maybe Pierre could make it easier
 

Just to be sure, you'd like the pop-up list to be:
  1. Fixed list
  2. List of all values entered
  3. List coming from a list of items
  4. List coming from all items in another grid
  5. List coming from another IQBase
  6. List coming from a table in an Access database
All of these are possible.

srv181

2009/02/09 04:31

In reply to by Pierre_Admin

Hi Pierre,
 
options 4. (and possibly 3) are the ones I am looking for.
 
@Tom: thanks for the tip, however, my project team keeps changing and going in to manually update and reorder the list is too tedious - I have been spoiled by great programs like IQ , but thanks for the tip!
 

Pierre_Admin

2009/02/09 10:17

In reply to by srv181

Option 4:
 
Assumptions:
  1. You have a grid named AdrsBook, which contains the list of contacts that you want to populate a new field
  2. You want the popup list field to be named "MyContacts"
 
Steps:
  1. Open Field management
  2. Create a new text field (name=MyContacts)
  3. In the Editor > Pop-up list , enter:
    Select Item as MyContacts from AdrsBook
  4. Click Save and Close
  5. Include the new field in your grid. You may need to close and re-open the grid.
More ways are possible to achieve the same pop-up list. You can even have multiple fields assigned at once
 

srv181

2009/02/10 03:08

In reply to by Pierre_Admin

This is absolutely fantastic Pierre!!!
 
Thank you for the help and, above all, thanks for such a great product!
 
This will make many things just soooo much easier
 
- can you tell I am really enthused  ?
 
thanks again

Pierre_Admin

2009/02/10 10:31

In reply to by srv181

Great!
 
If you prefer, you can use another field for the pop-up list, for each contact, enter the contact initials in another field and you'll be able to use it

srv181

2009/02/10 14:45

In reply to by Pierre_Admin

If you prefer, you can use another field for the pop-up list, for each contact, enter the contact initials in another field and you'll be able to use it
 
sorry, now you have lost me.
 
But please, do get well before bothering to explain, I am quite happy with the way it is working (Except for the wrong order - items not alphabetical)
 
but take care of yourself first!
 
 
 
 
 

Armando

2009/02/19 19:02

In reply to by srv181

"You can use another field" means... instead of having :
 
Select Item as MyContacts from AdrsBook
 
you could have
 
--> Select FirstName as MyContacts from AdrsBook
 
Which, if you had such a field named "FirstName", would populate the list with "first names"
 
Or you could even have
 
--> Select FirstName,LastName as MyContacts from AdrsBook
 
Which, if you had such fields named "FirstName" and "LastName", would populate the list with first names and last names.
 
Not sure what's the use of  "AS" in this context since it seems to me that the list would work with simply :
 
--> Select FirstName,LastName from AdrsBook
 
... But I'm no SQL expert.
 

Pierre :  I tried using AND and OR, to no avail. What am I doing wrong ?
 
SELECT FirstName,LastName FROM adrsbook_ WHERE category LIKE "%tgsPRoJu%" OR project LIKE "%tgsPRoJu%"
 
 

Armando

2009/02/19 19:51

In reply to by Armando

btw, the order of items in the list depends on the sorting filter (check the sorting filter in the source bar) in the grid/table from which the data is derived.

srv181

2009/02/23 23:11

In reply to by Armando

Armando,
thanks for your replies; regarding the Field as Item etc. I was just thinking too complicated,
the tip with ordering the original grid with the source bar is great - sometimes the obvious is too subtle for me
 
Thanks again and btw: as far as I can determine, none of the clauses that you can have in a select statement seem to work (or I would have used the ORDER BY)

Pierre_Admin

2009/02/24 15:59

In reply to by srv181

it seems that JET is having problems with sorting memo-type fields (all IQ text fields are of type memo). I've put a note to handle this transparently to the user, but at the moment, you need to use the following to get the sorting to work correctly:
 
 ORDER BY Left([Item],255)
 
(instead of simply ORDER BY Item)
 

Armando

2009/02/22 12:53

In reply to by Armando

Bump.
Pierre or anybody else familiar with SQL syntax... ?
Trying to understand why OR (or AND) won't work in this line :
 
SELECT FirstName,LastName FROM adrsbook_ WHERE (category LIKE "%tgsPRoJu%" OR project LIKE "%tgsPRoJu%")
 
 
Thanks.

Pierre_Admin

2009/02/24 16:03

In reply to by Armando

You need to use the ADO syntax: WHERE YourField ALIKE "%YourString%"
 
[edit] I've modified my dev. build to automatically replace LIKE with ALIKE so users can use both syntax

Armando

2009/02/24 17:50

In reply to by Pierre_Admin

Thanks Pierre. :)
 
Will try that.

A new book page now discusses this: -- link to nonexistent node ID 294 --

gregory

2020/10/16 05:22

In reply to by Pierre_Admin

Hi Pierre.
 
Small point: The book page needs re-referencing.
 
MAIN POINT: We still do not have a proper equivalent to what Microsoft Access calls a lookup field. In a relational database, the values taken by a lookup field can only come from values already stored in the parent table of a parent-child relationship. In other words, we enforce referential integrity. I do appreciate that to enforce referential integrity in InfoQube would be an expensive operation. Therefore, I would like to suggest that this be implemented as a field-specific option. Strictly speaking, it should be possible to insist on referential integrity against more than one parent table, but I could easily live with an implementation where only one such table is allowed.

For anyone who has no idea what I am talking about, I am suggesting that a field called colour in a child grid called paint should be restricted to certain values that come from a parent colour field in another grid. If the parent grid contains only red, blue, green, it should not be possible to insert the value white as a value for the colour attribute in the child paint grid unless and until you have previously inserted white as an additional colour in the parent colour grid. This should also be adequate in a situation where your grid wishes to show both a father and a mother for entries which describe a child.

 
At the moment, even if a pop-up list shows only red, blue, green, it is possible to insert as a value any old rubbish such as "this value should not be allowed".
 
Mark GREGORY, Saumur, France - GMT +2; EST +7