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!

Linking tabs on forms problem with combo box clearing out

Status
Not open for further replies.

redsand23

Technical User
Feb 22, 2002
77
US
Hello all,
I am having trouble with a combo box field clearing out. Here is what I am trying to do
I have 2 tabs one with customer info and the other with customer history, I am linking them by customer name. On the combo box cmbCustomerNumber is looking up customer name and number from tblCust. On the After update here is my code

Private Sub cmbCustomerNumber_AfterUpdate()
Dim Customer1 As String

'Populate CustomerNumber Field Non Editable field
Me.CustomerNumber = Me!cmbCustomerNumber.Column(1)

'Populate CustomerName Field
Me.CustomerName = Me!cmbCustomerNumber.Column(0)

The history tab is working great it is linking great. The problem I am having is when I step though the afterupdate code, It is clearing out the value of the combo box. I want to retain the value of the combo box. I have tried several things, such as
Me!cmbCustomerNumber.Value = Customer1
I know I am missing something easy.

Thanks





End Sub
 
Does anyone have a solution to this? I'm having a similar problem. I keep running into this on this forum, I find my problem, but no one's bothered to address it
 
You can use the Column property to assign the contents of a combo box or list box to another control, such as a text box. For example, to set the ControlSource property of a text box to the value in the second column of a list box, you could use the following expression:

=Forms!FormName!cboboxName.Column(1)
Remember amateurs built the ark - professionals built the Titanic

[flush]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top