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

Updating a comboBox on a different tab.

Status
Not open for further replies.

pdbowling

Programmer
Mar 28, 2003
267
US
Hello, Everyone.

I am using MS Access 2010 Version 14.0.61.29.5000.

I have a form that I am supporting. It has several tab pages. I need to get a combox on page3 to update when I change a combobox on the main tab (page1).

I tried to do this on the onchange event but ran out of intellisense options that made sense to me.


Me.Page3.Controls.Item(2) = Me.Combo304.Text
(2 is the tab index on the combobox)

It says 'You can't assign a value to this object. How should I go about this correctly?

Thanks

 
You don't need to worry about tab pages in the expressions. Also, in Access we rarely reference the "Text" property. We typically use the "Value" property which is mostly left off since it's the default property of bound controls.

You should be able to use code like:
Code:
Me.NameOfComboBoxOnPage3 = Me.Combo304

BTW, you really should take the seconds required to rename your controls. Combo304 doesn't provide any value to someone looking at your code.

Duane
Hook'D on Access
MS Access MVP
 
How are ya pdbowling . . .

The [blue]AfterUpdate[/blue] event would be a better choice here as it signals a value has been committed to the control. [blue]AfterUpdate[/blue] also exists for the record.

[blue]Your Thoughts? . . .[/blue]

See Ya! . . . . . .

Be sure to see faq219-2884 [blue]Worthy Reading![/blue] [thumbsup2]
Also faq181-2886 [blue]Worthy Reading![/blue] [thumbsup2]
 
Thank you, Everyone.

I am supporting a pre-existing system. I renamed the combo304 anyway. ;)

Patrick
 
> in Access we rarely reference the "Text" property. We typically use the "Value" property

There is a fundamental difference between the two. To clarify: Setting the Text value will trigger the Click and Change events. Setting Value will not.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top