How to get only one drop down enabled out of two if out of two choices one is met at

mahenkj2

Registered User.
Local time
Today, 21:25
Joined
Apr 20, 2012
Messages
459
I am new to MS Access and making a database for my plant maintenance. I have two choices i.e. Breakdown or Job order. I should select either of one. Then I make two drop downs, one is maintenance request name and another is Job order request name. The question is, If I select maintenance choice above, then I should go directly to maintenance request name drop down and in that case Job order request name drop down should be disable.

Kindly advise suitable solution. Please let me know if the above information is sufficient.

best regards.
 
can this example be used in tables besides forms? If so and OK to ask, how did you do it?
 
No, not in tables....

And you can see the code by going to designview on the form. Right click on the choice dropdown, go to properties, click in the AfterUpdate field and then click the little button that appears!~)

So the code executes after you update the dropdown and as you can see I have put the same code on the FormCurrent event so the form will execute the code everytime you move around in the recordset otherwise the form would 'forget' if you navigated away and back again...
 
@Severin, Many thanks for very prompt advise. I have checked the attached file and it is working fine as desired by me. In fact, this solution seems to easier than being used in Northwind.

Anyway, in the beginning I took lot of time to identify that "Enable Content" was not activated, so the solution as standalone was not working, but anyway its ok now.

I have copied the code and struggling for the full day today to let it work in my db. At this moment, it is showing "compile error Variable not defined" but I hope I will get through.

Many thanks again.

best regards.
 
Have you named your dropdownboxes to the names in my db or changed the code to your names?~)

...if you don't get it to work, let me know and I will have a look at your db!~)
 
@Severin, I could make a form with my choice of field names and edited your advised codes by changing as required and standalone this form is working fine. But the problem is that I want to add some existing fields from other tables in this form and in that case the record source of this form changes. After this change choice drop down beeps and does not work.

Now there are no compile errors.

Kindly advise to do as above, where else should I make any changes.

best regards.
 
the controlsource on the different comboboxes have to picked from the fields available from the recordsource on the form!~)
 
I was able to finally make a form to fulfill my requirements. I am very new to Access and so may be my basics are not so clear. Still, I would like to share the mistakes I was doing:

1. In first instance I did well in editing the code and naming of dropdowns but still the form did not work. The reason I concluded was I was using 'Job Order' in code and it was showing compile error. Later I deleted the space and form worked. Although, in all places of my table, I used Job Order. I do not know if this conclusion is correct!

2. Later, I wanted some fields from another table and in that case, form again did not work. Now I made a new from from scratch and used the lookup tab as list box of the desired fields.

Anyway, Many thanks Severin, for your kind support.
 
Thank you both Severin and Pat Hartman for all your answers. If I may ask, can you suggest a reative quick way to learn some ins and outs of access? Also, if I send you a databse sample of what I would like to accomplish, would you mind helping out?
 
send a mail and I will have a look!~)
 
Last edited:

Users who are viewing this thread

Back
Top Bottom