2
votes

I have a table for machinery items which has many columns. In order to enable the users to enter specific information without confusion I divided the columns into some forms based on type and sub-type fields in the table. For example type1 and subtype1 have specific columns and they are kept in a type1-subtype1 form and type2 and sub-type2 in type2-subtype2 form and so on. I have a total of 5 types and 5 subtypes, so I have a total of 25 forms. I used two combo boxes in a new form for type and subtype as given in the figure, I want to select type from type combo and sub-type from sub-type combo and when I click the open form button IT SHOULD DISPLAY THE RESPECTIVE FORM.enter image d escription here For example if the user selects type5 from type combo and subtype3 from subtype combo then type5-subtype3 form should be displayed and so on for all the 25 forms. I tried playing around the [on click] embedded macro for the open form button, but in vain. Is it ever possible to do this in this method in access or please suggest a method. It would be very helpful for me. Thank you very much!

1
Are those 25 forms really so much different that you can't use a single form with data controls which are enabled/disabled based on the current type/subtype combination? I would try hard to find a way to avoid the need for so many separate forms. - HansUp
Absolutely! 25 forms is excessive. - Fionnuala
@HansUp It is a worthy point..I will work to reduce the number of forms..thanks for the suggestion - alex

1 Answers

2
votes

EDIT changed combo box property from Selected to Value

Sometimes are limited and won't let you set a property as a string. Looks like this might be one of those cases. If so, you can always use Visual Basic ("Code Builder") instead of an embedded macro. Inside the Click handler, something like this:

Dim formName As String
formName = type.Value & "-" & subtype.Value
DoCmd.OpenForm formName