combo box to fill textbox's values

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

Guest

I have a combo box which is named Consumerinfo. It has consumer names,
medicalassistance #s, and what program they are in. Is there anyway I can get
those last two values (MA# and program) to automatically move into a text box
after the consumername is chosen. Or is there a way to get the information in
the 2nd and 3rd column of the drop box to go to a table named information.

Thanks

Jeremy
 
In the AfterUpdate of the combo box try this:

Me![MedNumber] = Me!ComboBox.Column(1)
Me![Program] = Me!ComboBox.Column(2)

Hope this helps.
 
When I code that into vb:


Private Sub ConNameCombo_AfterUpdate()
Me!ConNameCombo.Column(1) = Me![MA#]
Me!ConNameCombo.Column(2) = Me![Program]

End Sub


It is just giving me and error is there something I am doing wrong? But I
tried going about it by making two other text boxes and changed thier control
sources to:

=[ConNameCombo].[Column](1)
=[ConNameCombo].[Column](2)


Which works but is there a way to save those values to a table?


That works fine

Penguin said:
In the AfterUpdate of the combo box try this:

Me![MedNumber] = Me!ComboBox.Column(1)
Me![Program] = Me!ComboBox.Column(2)

Hope this helps.

I have a combo box which is named Consumerinfo. It has consumer names,
medicalassistance #s, and what program they are in. Is there anyway I can get
those last two values (MA# and program) to automatically move into a text box
after the consumername is chosen. Or is there a way to get the information in
the 2nd and 3rd column of the drop box to go to a table named information.

Thanks

Jeremy
 
Try this:

Private Sub ConNameCombo_AfterUpdate()
Me![MA#]=Me!ConNameCombo.Column(1)
Me![Program]=Me!ConNameCombo.Column(2)
End Sub

When I code that into vb:


Private Sub ConNameCombo_AfterUpdate()
Me!ConNameCombo.Column(1) = Me![MA#]
Me!ConNameCombo.Column(2) = Me![Program]

End Sub


It is just giving me and error is there something I am doing wrong? But I
tried going about it by making two other text boxes and changed thier control
sources to:

=[ConNameCombo].[Column](1)
=[ConNameCombo].[Column](2)


Which works but is there a way to save those values to a table?


That works fine

Penguin said:
In the AfterUpdate of the combo box try this:

Me![MedNumber] = Me!ComboBox.Column(1)
Me![Program] = Me!ComboBox.Column(2)

Hope this helps.

I have a combo box which is named Consumerinfo. It has consumer names,
medicalassistance #s, and what program they are in. Is there anyway I can get
those last two values (MA# and program) to automatically move into a text box
after the consumername is chosen. Or is there a way to get the information in
the 2nd and 3rd column of the drop box to go to a table named information.

Thanks

Jeremy
 
Thanks it worked but it was a pain in the ass. I had to put the first column
line in without the second then close out run it and then go back in and put
the second line in so that it wouldnt keep coming up with a runtime error but
it works perfectly now. Thanks so much.

Penguin said:
Try this:

Private Sub ConNameCombo_AfterUpdate()
Me![MA#]=Me!ConNameCombo.Column(1)
Me![Program]=Me!ConNameCombo.Column(2)
End Sub

When I code that into vb:


Private Sub ConNameCombo_AfterUpdate()
Me!ConNameCombo.Column(1) = Me![MA#]
Me!ConNameCombo.Column(2) = Me![Program]

End Sub


It is just giving me and error is there something I am doing wrong? But I
tried going about it by making two other text boxes and changed thier control
sources to:

=[ConNameCombo].[Column](1)
=[ConNameCombo].[Column](2)


Which works but is there a way to save those values to a table?


That works fine

Penguin said:
In the AfterUpdate of the combo box try this:

Me![MedNumber] = Me!ComboBox.Column(1)
Me![Program] = Me!ComboBox.Column(2)

Hope this helps.

On Tue, 4 Jan 2005 13:31:06 -0800, "stag246"

I have a combo box which is named Consumerinfo. It has consumer names,
medicalassistance #s, and what program they are in. Is there anyway I can get
those last two values (MA# and program) to automatically move into a text box
after the consumername is chosen. Or is there a way to get the information in
the 2nd and 3rd column of the drop box to go to a table named information.

Thanks

Jeremy
 
Ok now the dumb thing isnt working again. I put more vba code for a different
form
Private Sub Attendantcombo_AfterUpdate()
ConInfoCombo.RowSource = "SELECT CName FROM PurposeofActivities Where
Coordinator = """ & Me!Attendantcombo & """ ;"
End Sub


and now the code the form isnt working now I have


Private Sub ConNameCombo_AfterUpdate()

Me!medicalAssistanceNumber = Me!ConNameCombo.Column(1)
Me!Coordinator = Me!ConNameCombo.Column(2)
Me!Program = Me!ConNameCombo.Column(3)


End Sub



and i have in the control sources of the text boxes
(medicalAssistanceNumber, Coordinator, Program) which are in same order as
below


= Me!ConNameCombo.Column(1)
= Me!ConNameCombo.Column(2)
= Me!ConNameCombo.Column(3)


Now this adds the MA# into the table and it all work for a little while and
also added the coordinator and program but now it doesnt work. I do not know
what to do now and if i take those out of the control source it still doesnt
change anything but the vba code then works. I dont understand why it worked
and then all the sudden stop.

if you can give any help let me know.

Jeremy

Penguin said:
Try this:

Private Sub ConNameCombo_AfterUpdate()
Me![MA#]=Me!ConNameCombo.Column(1)
Me![Program]=Me!ConNameCombo.Column(2)
End Sub

When I code that into vb:


Private Sub ConNameCombo_AfterUpdate()
Me!ConNameCombo.Column(1) = Me![MA#]
Me!ConNameCombo.Column(2) = Me![Program]

End Sub


It is just giving me and error is there something I am doing wrong? But I
tried going about it by making two other text boxes and changed thier control
sources to:

=[ConNameCombo].[Column](1)
=[ConNameCombo].[Column](2)


Which works but is there a way to save those values to a table?


That works fine

Penguin said:
In the AfterUpdate of the combo box try this:

Me![MedNumber] = Me!ComboBox.Column(1)
Me![Program] = Me!ComboBox.Column(2)

Hope this helps.

On Tue, 4 Jan 2005 13:31:06 -0800, "stag246"

I have a combo box which is named Consumerinfo. It has consumer names,
medicalassistance #s, and what program they are in. Is there anyway I can get
those last two values (MA# and program) to automatically move into a text box
after the consumername is chosen. Or is there a way to get the information in
the 2nd and 3rd column of the drop box to go to a table named information.

Thanks

Jeremy
 
Oh god thanks. Finally I figured it out. I was just being totally stupid
about it. Thanks for your help it was great work. I am dumb and gonna go
remiss in my stupidity for about 10 minutes. Thanks again for everything.

Penguin said:
Try this:

Private Sub ConNameCombo_AfterUpdate()
Me![MA#]=Me!ConNameCombo.Column(1)
Me![Program]=Me!ConNameCombo.Column(2)
End Sub

When I code that into vb:


Private Sub ConNameCombo_AfterUpdate()
Me!ConNameCombo.Column(1) = Me![MA#]
Me!ConNameCombo.Column(2) = Me![Program]

End Sub


It is just giving me and error is there something I am doing wrong? But I
tried going about it by making two other text boxes and changed thier control
sources to:

=[ConNameCombo].[Column](1)
=[ConNameCombo].[Column](2)


Which works but is there a way to save those values to a table?


That works fine

Penguin said:
In the AfterUpdate of the combo box try this:

Me![MedNumber] = Me!ComboBox.Column(1)
Me![Program] = Me!ComboBox.Column(2)

Hope this helps.

On Tue, 4 Jan 2005 13:31:06 -0800, "stag246"

I have a combo box which is named Consumerinfo. It has consumer names,
medicalassistance #s, and what program they are in. Is there anyway I can get
those last two values (MA# and program) to automatically move into a text box
after the consumername is chosen. Or is there a way to get the information in
the 2nd and 3rd column of the drop box to go to a table named information.

Thanks

Jeremy
 
Back
Top