Filling in an additional text box from a combo box

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi all! What I am doing is this:

I have a combo box named: cboBridge and it is a drop-down to a list of 5
bridges. In the table Bridges I have ID, Bridge and Height. I have set up my
row source with the SQL. Also, I have Column Count set to 2, and my Column
widths are 0";1" and Bound Column is 1.

I set up the following in my After Update procedure of my cboBridge:

Private Sub cboBridge_AfterUpdate()

On Error GoTo ProcError

Me.txtbridgeheight = Me.cboBridge.Column(2)

ExitProc:
Exit Sub
ProcError:
MsgBox "Error " & Err.Number & ": " & Err.Description, _
vbCritical, "Error in procedure Bridge_AfterUpdate..."
Resume ExitProc
End Sub

Where "txtbridgeheight" is the text box I would like populated with the
Height value corresponding to the bridge.

In my combo box, I get the list of Bridges (and height) and when I select
one, the correct height goes to "txtbridgeheight" but the name of the bridge
does NOT stay in cboBridge.

Can anyone tell me what I am doing wrong?

Thanks in advance!
Steph
 
Got it myself!!!! Pretty pscyhed! One question though...isn't that always
the way?? If I want to add another text box to be filled in, do I just add 1
more to my column count and change the code on my After Update?

Thanks
 
Back
Top