Text Box Results based on Combo Box and Another Text Box (1 Viewer)

cyliyu

New member
Local time
Today, 12:40
Joined
Jul 27, 2019
Messages
20
Need help, please!

I have a Combo box in the Form when the field was selected from the list.
I want a Text box 2 to show a result when certain criteria are meet based on the data selected from the Combo box and another Text box 1 info.
e.g.

CaseCombo BoxText Box 1Text Box 2
1APPUDT1 or DT2 or N.AACCU
2APPUMP1 or MP2 or MI1 or MI2APPU
3MPPUDT1 or DT2 or N.AMPPU
4MPPUMP1 or MP2 or MI1 or MI2LPPU
5PECCUDon't CarePECCU

The Text Box 2 will have the same result as the Combo Box if the condition not met.
 

theDBguy

I’m here to help
Staff member
Local time
Yesterday, 21:40
Joined
Oct 29, 2018
Messages
21,358
Hi. Are you using a single or continuous view form?
 

cyliyu

New member
Local time
Today, 12:40
Joined
Jul 27, 2019
Messages
20
I am using a single view form
 

theDBguy

I’m here to help
Staff member
Local time
Yesterday, 21:40
Joined
Oct 29, 2018
Messages
21,358
I am using a single view form
Hi. There's really lots of ways to do this. For example, you could use VBA or an IIf() expression in Text Box 2 or create a mapping table and then use DLookup() to get the right value. It would be better if you can add the value in your query, so you can just bind the Textbox to it.
 

cyliyu

New member
Local time
Today, 12:40
Joined
Jul 27, 2019
Messages
20
Thanks, theDBguy.
will try again the query method as I don’t get it works.
will check where goes wrong.
 

theDBguy

I’m here to help
Staff member
Local time
Yesterday, 21:40
Joined
Oct 29, 2018
Messages
21,358
Thanks, theDBguy.
will try again the query method as I don’t get it works.
will check where goes wrong.
Good luck. If you get stuck, maybe you can post a sample db, so we can help you make it work.
 

cyliyu

New member
Local time
Today, 12:40
Joined
Jul 27, 2019
Messages
20
Attached file the sample and would like to seek help.

In the frmRMA, the field LRU (combo box) and TextBox624 where I get stuck.
When a product was selected from the LRU and TextBox373 (Result based on Combo box319), I would like to have the result as shown in post 1 (Text Box 2).
 

theDBguy

I’m here to help
Staff member
Local time
Yesterday, 21:40
Joined
Oct 29, 2018
Messages
21,358
Attached file the sample and would like to seek help.

In the frmRMA, the field LRU (combo box) and TextBox624 where I get stuck.
When a product was selected from the LRU and TextBox373 (Result based on Combo box319), I would like to have the result as shown in post 1 (Text Box 2).
Okay. Not in front of a computer right now, but I'll take a look first thing tomorrow.
 
Last edited:

Users who are viewing this thread

Top Bottom