3rd Combo To Display Values Based on 2nd Combo - Both Tbls Are Different (1 Viewer)

Ashfaque

Student
Local time
Today, 06:48
Joined
Sep 6, 2004
Messages
894
Hi,

I have 2 Combos boxes on a form named CboMainCriteria and CboCriteriaDetails.
Combo CboMainCriteria is based on T_Violations tbl wherein 3 field called ‘Crietria’ , ‘Reason’ and ‘Justification’. Whereas second combo CboCriteriaDetails is based on table tbl T_Violations
T_Violations containes many criteria such as LATES, ABSENT Etc…. and each criteria has different reasons…> 15 min, > 30 Min….and so on… as follows.

LATES >15 Min
LATES > 30 Min
LATES More than 2 hrs.
ABSENT
ABSENT
ABSENT

CboCriteriaDetails rowsource data is based on CboMainCriteria and are working well using Me!CboCriteriaDetails.RowSource = Me!CboCriteriaDetails.RowSource line in After Update event of CboMainCriteria.

At present when I am updating data in CboMainCriteria , my second combo CboCriteriaDetails is generating correct relevant values.…which is fine.

What I am looking for is : I have 3rd combo called “CboStartSent” which is based on other table called “T_WarnSent” wherein “Criteria” & “Reason” are same fields as mentioned in T_Violations

BUT Please note CboStartSent record source is different tbl “T_WarnSent” wherein “Criteria” is same field as mentioned in tbl “T_Violations”

I want my third combo “CboStartSent” to display only those records that is relevant with my second combo “CboCriteriaDetails”

This is not happening because for third Combo I used another table as said.

So how can I do that? Any help shall be appreciated.
 

Ranman256

Well-known member
Local time
Yesterday, 21:18
Joined
Apr 9, 2015
Messages
4,339
ThE query in combo3,CboStartSent, has combo2 in the criteria.
Select field from table where field= forms!myForm!CboCriteriaDetails

But it you must refresh when user picks combo2

Code:
Sub CboCriteriaDetails_afterupdate
CboStartSent.requery
End sub
 

Ashfaque

Student
Local time
Today, 06:48
Joined
Sep 6, 2004
Messages
894
I have attached my db. I am concern with only colored Combo

When I update Crieteria combo...next combo "Reason" generates relevant field....both combo are based on one table source. But 3rd combo is generating lots of lines after updating second combo.

I need 3rd combo to generate only one line that is based on second combo (Reason..)
 

Attachments

  • Multiple ComboTest.accdb
    2.2 MB · Views: 278

theDBguy

I’m here to help
Staff member
Local time
Yesterday, 18:18
Joined
Oct 29, 2018
Messages
21,358
I have attached my db. I am concern with only colored Combo

When I update Crieteria combo...next combo "Reason" generates relevant field....both combo are based on one table source. But 3rd combo is generating lots of lines after updating second combo.

I need 3rd combo to generate only one line that is based on second combo (Reason..)
Hi. See if this is what you mean.
 

Attachments

  • Multiple ComboTest.zip
    720.1 KB · Views: 268

Users who are viewing this thread

Top Bottom