If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Pulling values from columns in a combo box.
I have a combo box that is populated from a table. It has two columns. I want
to take the value from the second column and fill in a field elsewhere on the form, on the afterupdate property. Right now i am using a macro to fill in other fields, so would like to use the setvalue function in a macro. Thank you, Bret |
#2
|
|||
|
|||
Pulling values from columns in a combo box.
Bret, I find the built-in helps useful, tho it took me some serious
time to figure out how to use them successfully! I think you want the .column property of the combo box (assuming that you cannot simply set the bound column property to 2). I know how to use it in VBA code; guess I'm not sure in a macro. I just looked and it wasn't in the expression builder list for one of my combo boxes. in any event, the column index counts from 0, so to use the 2nd column you would use Me.otherField = Me.yourComboBox.Columns(1) to get the value of the 2nd column in the first row. typing 'column property' in the help search box pulled up 'Properties of list boxes, combo boxes, (etc)' -- Clif On Apr 8, 3:16*pm, Bretona10 wrote: I have a combo box that is populated from a table. It has two columns. I want to take the value from the second column and fill in a field elsewhere on the form, on the afterupdate property. Right now i am using a macro to fill in other fields, so would like to use the setvalue function in a macro. Thank you, Bret |
#3
|
|||
|
|||
Pulling values from columns in a combo box.
This is a good place to start learning VBA. It is simple and, in this case,
easier than using a macro. Use the After Update event of the combo. Clif is correct in his advise except a minor syntax error, it is Column without an S. As you progress, you will be more and more frustrated with the limitiations of macros. One easy way to start understanding VBA is to convert a macro to VBA and compare the macro to the code. Macro's have limits. Error trapping is almost impossible. You will find that most professionals very seldom, if ever, use them. -- Dave Hargis, Microsoft Access MVP "Bretona10" wrote: I have a combo box that is populated from a table. It has two columns. I want to take the value from the second column and fill in a field elsewhere on the form, on the afterupdate property. Right now i am using a macro to fill in other fields, so would like to use the setvalue function in a macro. Thank you, Bret |
#4
|
|||
|
|||
Pulling values from columns in a combo box.
On Apr 8, 5:26*pm, Klatuu wrote:
This is a good place to start learning VBA. *It is simple and, in this case, easier than using a macro. Use the After Update event of the combo. *Clif is correct in his advise except a minor syntax error, *it is Column without an S. Minor, but definately critical! Thanks for catching it g -- Clif |
Thread Tools | |
Display Modes | |
|
|