cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

Lookup A Value Based on a ComboBox Selection

Hi,

 

I have two tables: dbo.Semesters and dbo.Courses.

 

I have an edit form connected to the dbo.Courses data.

 

I have a ComboBox in that edit form to select the correct semester title, and the Items property of that ComboBox connects to dbo.Semesters.

 

What I want to do is select the title of the semster ("Spring 2018") and have that data displayed in the ComboBox, while at the same time populating another text field named Semester ID with the ID from the dbo.Semesters table. The ComboBox is working properly. I just need the text field to autopopulate with the correct ID from the dbo.Semesters table, based on the selection from the ComboBox semester title. I'm thinking I need to have the text field do a Lookup based on the ComboBox selection.

 

How can I accomplish this?

 

Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Frequent Visitor

Re: Lookup A Value Based on a ComboBox Selection

The solution was to use a contextual variable. On the ComboBox, I set the OnChange and OnSelect property to UpdateContext({IDVAR: ComboBox2.Selected.AutoID}).

 

Then on the textbox where I want the ID to show up, I set its Default property to IDVAR.

 

 

View solution in original post

1 REPLY 1
Highlighted
Frequent Visitor

Re: Lookup A Value Based on a ComboBox Selection

The solution was to use a contextual variable. On the ComboBox, I set the OnChange and OnSelect property to UpdateContext({IDVAR: ComboBox2.Selected.AutoID}).

 

Then on the textbox where I want the ID to show up, I set its Default property to IDVAR.

 

 

View solution in original post

Helpful resources

Announcements
secondImage

Demo-Extravaganza 2020

Check out these cool Power Apps & vote on your favorite!

secondImage

Community Highlights

Check out whats happening in Power Apps

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (10,566)