Discussion Locked

microsoft access

0 helpful
5 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I created a form.
In the form there is an unbound combo box that puts information onto a field list that is set on a tab.
Is there a way to link a command button on a different form in the same database, to the information in the unbound combo box so that the information on the command button shows up in the combo box and then lets me see the information in the field lists?

5 replies

by donq

I'm sure there is but it might help to reword your question. It's a little confusing.

I assume you have a tabbed object (Tab 1, Tab 2, etc.) on a Form (Form 1) with an unbound combo box (Combo 1) displayed under either tab 1 or tab 2? You don'tsay where the combo boxes displayed data comes from and it would help if we knew what the combo boxes "Control Source" and "Row Source" properties said.

Anyhow - to refer to any Form object anywhere else within the same database open any Target Form and Field and place the following entry in that field's "Default Value" property: Forms![Form 1].[Combo 1]

Forms! refers to the entire collection of pre-defined Forms and [Form 1] identifies which collection member to use. [Combo 1] then refers which object to use within Form 1 and by default Access displays whatever value is in the combo box.

Again there are MANY types of command buttons and it is unclear from your words what you want the command button's "click" event to do? It almost sounds as though you want the command button to display a report to show ALL combo box values, and if that is so build a query that produces the required recordset and attach it to the report's "Record Source" property.

by shmaltz

Only if the form is running and here is how you do it:
form1.combobox1.selection=form2.combobox.selection
I didnt do VBA for a long time but i remember that thats the way to do it, but im not sure if selection is the right property for tha selected value of an access combobox, however this is the syntex you have to use.

This discussion is closed to new replies.