Combo Row SOurce Value List Data - Where are they lovcated

  • Thread starter Thread starter Milan Wendl, aaaengineering.com
  • Start date Start date
M

Milan Wendl, aaaengineering.com

Please help,

I have changed in the code some text info in the code, which value list is
compared by Replace on many form and now I have to change the same text data
stored in the value list of combo buttons, which are stored somewhere (hidden
etc.) There are many forms afected and I really do not whant to go to each
form, look for combo buttons and change value list by hand one by one.

I wonder if one can access and replace these data faster somehow. Is there
hidden or system table somewhre out there to go to?

Thanks for advise.

Milan.
 
"Milan Wendl, aaaengineering.com"
Please help,

I have changed in the code some text info in the code, which value list is
compared by Replace on many form and now I have to change the same text
data
stored in the value list of combo buttons, which are stored somewhere
(hidden
etc.) There are many forms afected and I really do not whant to go to each
form, look for combo buttons and change value list by hand one by one.

I wonder if one can access and replace these data faster somehow. Is there
hidden or system table somewhre out there to go to?

Thanks for advise.

Milan.


Here's an example of how to do this programmatically ...

Public Sub ReplaceValueList(ByVal strOldList As String, ByVal strNewList As
String)

Dim aob As AccessObject
Dim frm As Form
Dim ctls As Controls
Dim ctl As Control
Dim cbo As ComboBox

For Each aob In CurrentProject.AllForms
DoCmd.OpenForm aob.Name, acDesign, , , , acHidden
Set frm = Forms(aob.Name)
Debug.Print frm.Name
Set ctls = frm.Controls
For Each ctl In ctls
If ctl.ControlType = acComboBox Then
Set cbo = ctl
If cbo.RowSourceType = "Value List" Then
If cbo.RowSource = strOldList Then
Debug.Print cbo.Name
cbo.RowSource = strNewList
End If
End If
End If
Next ctl
DoCmd.Close acForm, aob.Name, acSaveYes
Next aob
Debug.Print "Finished"

End Sub

Here's an example of how to use it from the Immediate window ...

replacevaluelist "one;two;three", "four;five;six"

This will find any combo box which has a row source type of "Value List" and
a row source of "one;two;three" and replace the row source with
"four;five;six".
 
Please help,

I have changed in the code some text info in the code, which value list is
compared by Replace on many form and now I have to change the same text data
stored in the value list of combo buttons, which are stored somewhere (hidden
etc.) There are many forms afected and I really do not whant to go to each
form, look for combo buttons and change value list by hand one by one.

I wonder if one can access and replace these data faster somehow. Is there
hidden or system table somewhre out there to go to?

Thanks for advise.

Milan.

Brendan's solution should work for you... but just for the future, and for the
lurkers, this is one main reason NOT to use Value List combos. If the combo is
based on a query of a Table, then you can update the table once, in one place,
and all of the combos are instantly and quietly fixed.
 
Back
Top