LjushaMisha
Registered User.
- Local time
- Today, 16:04
- Joined
- Mar 10, 2017
- Messages
- 68
Hi to ALL.
I'm "building" a form with 3 combo boxes:
First is ValueList RowSourceType, RowSource = "Tables";"Queries";Forms"
Depending on decision from first cbo I get the names of all tables Except left(name,4) = "MSys", all queries and all forms
Depending on decision of second cbo I get names of all fields in third cbo (RowSource type = Field list) SO FAR SO GOOD
Now I'd like to make some code to put Control names (except LABELS) in third cbo IF value in first cbo is "Forms" and decission in
second cbo is made (AfterChange Event)
Here is some kind of what I'm trying to do:
Dim f As I don't know what - form, variant, string, AccessObject, ...
Dim c As Control
Debug.Print Forms!frmdbox.cboNames.Value 'Just for testing reason - IT WORKS. So I tried next line
f = Forms!frmdbox.cboNames.Value ' Doesn't work, Missing object
Debug.Print f
DoCmd.OpenForm f, acDesign 'As I can't work with AllForms collection I have to open THE FORM named in third cbo box
For Each c In Forms!s.Controls
' If I could came here I think I would be capable to write code to make Value list from control names and
' change rowsourceType and RowSource
'c = ""
' c = c + chr(34) + c.name + chr(34) + ";" or something like that
Next
End Sub
----> In short terms, I'd like tu use value from combo box in For Each ... Next statementu
ANY HELP, PLEEEEEESE
I'm "building" a form with 3 combo boxes:
First is ValueList RowSourceType, RowSource = "Tables";"Queries";Forms"
Depending on decision from first cbo I get the names of all tables Except left(name,4) = "MSys", all queries and all forms
Depending on decision of second cbo I get names of all fields in third cbo (RowSource type = Field list) SO FAR SO GOOD
Now I'd like to make some code to put Control names (except LABELS) in third cbo IF value in first cbo is "Forms" and decission in
second cbo is made (AfterChange Event)
Here is some kind of what I'm trying to do:
Dim f As I don't know what - form, variant, string, AccessObject, ...
Dim c As Control
Debug.Print Forms!frmdbox.cboNames.Value 'Just for testing reason - IT WORKS. So I tried next line
f = Forms!frmdbox.cboNames.Value ' Doesn't work, Missing object
Debug.Print f
DoCmd.OpenForm f, acDesign 'As I can't work with AllForms collection I have to open THE FORM named in third cbo box
For Each c In Forms!s.Controls
' If I could came here I think I would be capable to write code to make Value list from control names and
' change rowsourceType and RowSource
'c = ""
' c = c + chr(34) + c.name + chr(34) + ";" or something like that
Next
End Sub
----> In short terms, I'd like tu use value from combo box in For Each ... Next statementu
ANY HELP, PLEEEEEESE