I have a form that allows me to enter an inventory item. It has an 'if' statement linked to a drop down box, which if the proper item is selected, additional data fields are populated. This works great if I am entering in a new inventory item.
Problem Im having, is I have a link elsewhere that opens this form to a specific record based on its ID. This also works great. The only problem is that if this record has data in the hidden fields (which become visible only when the appropriate drop down box option is selected) these fields remain hidden.
If this makes any sense.
Here it is again in a little more detail.
I keep an inventory of all of our machinery and equipment. When you select "Enter New Inventory Item" a form pops up. On this form is a number of fields. Some are drop down boxes. If the drop down box pertaining to Equip Type, is set to Machinery, there are 10 or 15 additional fields originaly set to "not visible" which become visible. These fields gather engine information, model #, serial #, Oil type, Filter Size, etc...
Not all of our equipment requires storing this additional info so it is hidden untile the appropriate option is selected int the Equip Type box.
This works great when entering new data in.
Problem I am having is, I have a link elsewhere in my database for a record lookup, which opens the same form but sets it to the appropriate record based on the ID#. This too works good. The problem I am having is that if record I am looking up is of Machinery type, the hidden fields remain hidden. If I manually edit the form and set them to visible, the data is popluated into the appropriate field as it should be.
So my question is, how to open this form to a specific record, and at the same time satisfy the "if" statement that either keeps the added fields hidden, or sets them to visible.
Here is my call statement for opening form via the Item LookUp Link.
strFrmName = "Vehicle Details"
strWhere = "[Veh ID#] = """ & Me.[TextVehID] & """"
DoCmd.OpenForm "Vehicle Details", , , strWhere, acFormReadOnly
Bookmarks