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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PROBLEM ABOUT COMBO BOX

Status
Not open for further replies.

desikan

Technical User
Feb 2, 2001
105
AE
I have a continous form say Form1 having fields field1,field2,field3 and also has a command button that opens up Form2 with a new record.

Now Form2 has a bound combo box (bound to field1) whose Row source property is based on value of field1 in Form1.

My problem os that when Form2 opens, the combo box value is available (value of field1 selected in Form1) but not displayed.

I need some clues as to what exactly is to be done to get the value displayed directly on the combo box in Form2

Thanks in advance
 
One approach would be to:
1. create a public variable in a module.
2. when the user selects a record in Form 1, add code that sets the value of the public variable to the value of Field1
3. In the on-open event of Form 2 set the value of the combo box to the value of the public variable.
 
Can't you put this right after the OpenForm form command in Form1?

Forms!Form2.ComboBoxName = Me.Field1

Works for me. Or am I missing something?

ProDev, MS Access Applications
Visit me at ==> Contact me at ==>lonniejohnson@prodev.us

May God bless you beyond your imagination!!!
 
I think he's trying to set the rowsource, not the value of the combo box. If that's the goal, I don't think it can be done very well. I've tried several times, gone for help on it, and never gotten it to work. I wouldn't take this as definitive, but I don't think it's possible.

Jeremy

==
Jeremy Wallace
AlphaBet City Dataworks
Access Databases for Non-Profit Organizations

Please post in the appropriate forum with a descriptive subject; code and SQL, if referenced; and expected results. See thread181-473997 for more pointers.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top