• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 354
  • Last Modified:

Checking a value in textbox 1 to assign a value in textbox 2

I was wondering what would be the best way to automatically insert a value in textbox 2 if textbox 1 = A. An alternatively, if textbox 1 = B, then textbox 2's value would be different?
0
DanaCurnock
Asked:
DanaCurnock
1 Solution
 
flavoCommented:
Hi Dana!

private Sub textbox1_Afterupdate()
  If Me.textbox1.value = "a" Then
        Me.textbox2.value = "something"
  elseif me.textbox1.value = "b" then
        Me.textbox2.value = "something else"
  else
      Me.textbox2.value = "something totally different"
  end if
end sub

More help?

Dave
0
 
JohnK813Commented:
Well, the basic command would be

If textbox1.Value = "A" Then textbox2.Value = "whatever"

But where to put it would depend on how textbox1 gets its value.  Is textbox1 getting filled from a table or query, or from someone typing something in?
0
 
jjafferrCommented:
Hi DanaCurnock,
put this after update of Textbox1
Select [Textbox1]
case 1
 [Textbox2]= "A"
case 2
 [Textbox2]="B"
endselct

I hope this helps.

jaffer
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
DanaCurnockAuthor Commented:
JohnK813

The values are being either typed or filled by another cbobox.

0
 
DanaCurnockAuthor Commented:
jjafferr

I will be more detailed:

If txtTruckNumber = "C00981" Then

       txtTare = "12680"
       txtAggregateWeight = "25400"
ElseIf txtTruckNumber = " " Then

Else

End If
0
 
DanaCurnockAuthor Commented:
flavo

I missed you comment...is this correct???
0
 
flavoCommented:
i did what?
0
 
DanaCurnockAuthor Commented:
Comment from flavo
Date: 04/14/2005 06:10AM PDT


I missed your comment...is this correct???

If txtTruckNumber = "C00981" Then

       txtTare = "12680"
       txtAggregateWeight = "25400"
ElseIf txtTruckNumber = " " Then

Else

End If
0
 
flavoCommented:
That was the idea i posted..
0
 
flavoCommented:
:-)

Good luck with the rest of your app Dana!
0

Featured Post

 [eBook] Windows Nano Server

Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks

Tackle projects and never again get stuck behind a technical roadblock.
Join Now