Passing Values with OpenArgs

J

Jaybird

I'm trying to pass a value from my modal popup form to a text field on
another form. Works great except that only the index is passed. Any way I
can choose which column gets passed to the text box? My popup form uses a
combobox to select employees from a list. If the user inputs a password that
matches the one from the table, then the value for the employee to the other
form. But only the index. How can I get the actual name to be passed to my
main form?
 
K

Ken Snell \(MVP\)

Check out the .Column property of the combo box. It's a zero-based property,
meaning that .Column(0) is the first column in the combo box, .Column(1) is
the second column, etc.

strOpenArgs = Me.ComboBoxName.Column(x)

where x is the column index number.
 
J

Jaybird

I've been messing around with that all morning... I haven't been able to do
a thing with it. Granted, the destination was, at first, a combobox which I
have since converted to a text box... Can't remember if I tried it afterward
or not. Funny how responding to these messages gets you to thinking.

--
Why are you asking me? I dont know what Im doing!

Jaybird


Ken Snell (MVP) said:
Check out the .Column property of the combo box. It's a zero-based property,
meaning that .Column(0) is the first column in the combo box, .Column(1) is
the second column, etc.

strOpenArgs = Me.ComboBoxName.Column(x)

where x is the column index number.
 
M

Marshall Barton

Jaybird said:
I'm trying to pass a value from my modal popup form to a text field on
another form. Works great except that only the index is passed. Any way I
can choose which column gets passed to the text box? My popup form uses a
combobox to select employees from a list. If the user inputs a password that
matches the one from the table, then the value for the employee to the other
form. But only the index. How can I get the actual name to be passed to my
main form?


Check VBA Help for the combo box's Column property.
 
J

Jaybird

Shoop a doopy... The underlying table's field was number, instead of text!
I had it that way so that it would accept the value of the combobox. I had
the employees table queried into the record source. Removed it, changed the
field to text and 'Voila!' I got my values. Sheesh, what a pain!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top