Insert relevant value based on selection

paulcraigdainty

Registered User.
Local time
Today, 14:46
Joined
Sep 25, 2004
Messages
74
I have a form with a combo box this combo box looks up values in my STC table. The STC table has two fields STC & Resolver and each STC has a unique associated Resolver. What i want to happen is after the user has selected the STC from the combo box on the form the associated Resolver be displayed in a textbox on the form. I am ussing the following code but nothing seems to be happening:

Private Sub cboSTC_AfterUpdate()
Dim ResolverSource As String

ResolverSource = "SELECT tblSTC.[Resolver] " & _
"FROM tblSTC " & _
"WHERE tblSTC.[STC]='" & Me.cboSTC.Value & "';"

Me.txtResolver.RowSource = AgentSource
Me.txtResolver.Requery


End Sub
 
1st off the text boxes do not have a row source property. You need to change your code so that the value of the text box is changed to the resolver that is selected.

me.txtResolver.value = AgentSource

Assuming AgentSource is a valid string value.
 

Users who are viewing this thread

Back
Top Bottom