lookup help needed for selective items depending on previous field

arnold_fok

New Member
Joined
Nov 30, 2022
Messages
7
Office Version
  1. 365
Platform
  1. Windows
calculated field : iff([bank]=9,'abc','cat') shows correctly
SELECT list.id, list.name FROM list WHERE list.soort='in' Or IIf([bank]=9,'abc',' cat'); shows other soort as wel (no where clause?)
( list is table with multiple lookups works fine if not want different short list depending on other field)
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
calculated field : iff([bank]=9,'abc','cat') shows correctly
SELECT list.id, list.name FROM list WHERE list.soort='in' Or IIf([bank]=9,'abc',' cat'); shows other soort as wel (no where clause?)
( list is table with multiple lookups works fine if not want different short list depending on other field)
the space before cat is only here by accident, if i test sql with popup it shows correctly, but in lookup its always cat+in never abc+in
 
Upvote 0
"iff([bank]=9,'abc','cat') shows correctly"???????

The immediate if command is iif not iff
 
Upvote 0
"iff([bank]=9,'abc','cat') shows correctly"???????

The immediate if command is iif not iff
1669912138829.png
 
Upvote 0
Welcome to the Board!

Can you show us a small sample of your data table, and explain exactly which of those records you want to return?
 
Upvote 0
Welcome to the Board!

Can you show us a small sample of your data table, and explain exactly which of those records you want to return?
the list table has 3 fields : autonumber id,, txt name, txt group. the group refer to the field it should offer the dropdown list , this work correctly with a constant.
depending on a previous dropdown selection i like to have different dropdown to shorten the list and avoid wrong use example :
buy small article using $ ; buy large article using euro ; buy hughe article using yen that are different accounts different kind of articles , so by creating 3 groups extra the account should use the group related to that account. as stated before running the sql script it show different list depending the value i key in, just the way i like it. but having that script in my table dropdown it not show the true value like the script do.only the false value.
 
Upvote 0
the list table has 3 fields : autonumber id,, txt name, txt group. the group refer to the field it should offer the dropdown list , this work correctly with a constant.
depending on a previous dropdown selection i like to have different dropdown to shorten the list and avoid wrong use example :
buy small article using $ ; buy large article using euro ; buy hughe article using yen that are different accounts different kind of articles , so by creating 3 groups extra the account should use the group related to that account. as stated before running the sql script it show different list depending the value i key in, just the way i like it. but having that script in my table dropdown it not show the true value like the script do.only the false value.
(Like & "*" & Forms![FormName]![Combo1] & "*") i do not have forms i just use dataview, the combobox contain the query that runs fine on the place wherethat forms is suggested
1669922307927.png
d=dropdown,f=field,#=column,da/db=subdropdown
1669922614769.png

SELECT reference.reference
FROM reference
WHERE (((reference.dropdown)=(select distinct [reference] from reference where [id]= [Field1])))
ORDER BY reference.reference;
this sql show only the few related by dropdown and if reference is daf2 it show ef as expected
but as u see field2 is empty not ef
 
Upvote 0
I typically would not do this directly at the table level. I would usually do it at the Form level, and use VBA where you can control what gets updated when.
But there are a lot of other threads, tutorials, and videos out there dealing with the the subject if you just go a Google search on "Microsoft Access Table Drop-Down Field Dependent on Another Field".
Perhaps you will find something more to your liking.
 
Upvote 0
I typically would not do this directly at the table level. I would usually do it at the Form level, and use VBA where you can control what gets updated when.
But there are a lot of other threads, tutorials, and videos out there dealing with the the subject if you just go a Google search on "Microsoft Access Table Drop-Down Field Dependent on Another Field".
Perhaps you will find something more to your liking.
mmm u like to confuse ur colleagues by switching to forms while they learn to use lookup in database, but tnx
 
Upvote 0

Forum statistics

Threads
1,224,940
Messages
6,181,891
Members
453,068
Latest member
DCD1872

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top