Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

If info is put in to one text box, it must show something else in a other textbox 2

Status
Not open for further replies.

hendrikbez

Technical User
Nov 3, 2003
54
ZA
I have a access 2010 form, on it is a few textboxes and dates boxes.
I need when I put type info in first textbox eg. AGG666 and get to the other textbox, it must then show "UNIX" in it.

Here are the code I have, but it does not work, I am not good in vba at this moment.

first textbox name is Tape and control source is Tapes
Other textbox name is cmdsystem and control source is system

I do not think this code is correct to use, how can I do it so show the info I need in the other textbox

Code:
Private Sub cmdSystem_Click()
Displaytext = IIf([Tapes] = "AAG666*", "UNIX", "KK ")
End Sub

How will you spend eternity - Smoking or Non Smoking?
 
What is Displaytext ?

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
I am not sure, I did google and got it from there, That is wy I am thinking it is wrong, and I do not know how to get it to work

How will you spend eternity - Smoking or Non Smoking?
 
Get rid of the Click event procedure you posted.
In the AfterUpdate event procedure of the Tape control:
Me!cmdSystem = IIf(Me!Tape = "AAG666", "UNIX", "KK")

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Thank You, that is working, but is this possible to do.

I have more than 300 Different tape numbers and 3 systems, the 4 tape numbers that is for UNIX is AAG001 - AAG100, NSW001 - NSW100, NJQ001-NJQ120 and PRA001 - PRA100. How can I make this if I put only any one of this, it will change the other textbox to UNIX. Also 2 more systems Windows VM and Windows GP and they also have different tape names (not one of the tapes numbers will be the same for any system.

Hope this is possible


How will you spend eternity - Smoking or Non Smoking?
 
I'd use a table with 2 columns: Tape(PK),System
And then you may use joins in the queries and/or DLookUp in the forms.

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Ok I will try it, I do have a table with Tape and a table with Systems, but will try to use joins.

Thank You

How will you spend eternity - Smoking or Non Smoking?
 
Hi
Do you maby have a sample of how to do this, I do not understand it, and I do not know vba very good.

How will you spend eternity - Smoking or Non Smoking?
 

You need to create a SINGLE table with both data items.

[pre]Tape System
AAG001 UNIX
AAG002 UNIX
AAG003 UNIX
SOMETHING WINDOWS VM[/PRE] etc



Randy
 
thank you for helping me, I will do this now. what is next

How will you spend eternity - Smoking or Non Smoking?
 
Table done

How will you spend eternity - Smoking or Non Smoking?
 
In the AfterUpdate event procedure of the Tape control:
Code:
 Me!cmdSystem = DLookUp("Tape", "[name of your table]", "Tape='" & Me!Tape & "'")

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
PHV
Thank You for your help on this, it is working

How will you spend eternity - Smoking or Non Smoking?
 
Sorry for the typo:
Code:
Me!cmdSystem = DLookUp("[highlight #FCE94F]System[/highlight]", "[name of your table]", "Tape='" & Me!Tape & "'")

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Thanks I did see that it was wrong, I did change it, and it did work.

How will you spend eternity - Smoking or Non Smoking?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top