Showing/Hiding Subform

G

Grassy7

I know there are several posts on this subject, but none help my
situation. It's a big challenge.
Here's the setup:
parent form = frmOrders (source = tblOrders)
child form 1 = sbfrmOrderDetails (source = tblOrderDetails)
child form 2 = sbfrmProdSerialNum (source = tblProdSerialNum
All are linked by control "TransactionID".

sbfrmOrderDetails has a control called "cboProductDescription". It's
populated with a filtered list from another control
"cboProductCategory". 96% of all the Descriptions (all Categories) do
not have a serial number that needs to be tracked.

I want to keep the sbfrmProdSerialNum hidden, until a specific item
with a serial number is selected in the cboProductDescription
control. Code will go on it's AfterUpdate event I know. I can get
this to happen. However, I need for the sbfrmProdSerialNum to stay
visible for that entire record. If frmOrders has an item chosen in
the sbfrmOrderDetails that has a serial number, then
sbfrmProdSerialNum needs to stay visible, even after going to an old
record or new record on the main form. My code seems to just look for
the first record that has an item selected in cboProductDesription
that has an associated serial number. I need the code to look at the
entire record set associated with the main form, and see if that
specific item is in that set.

Please any help on this will be awesome. I'm trying to set this up
for my employer who needs it pretty bad. Thanks for any help!!!!
 
D

Danny J. Lesandrini

I'm not sure if you haven't reposted this question again more clearly, but I
got confused in the description and I suspect that's why no one has replied yet.

I think you're nearly at a solution here. You're correct that the AfterUpdate
event of the combo box could/should reveal the subform, but I'm not sure I
understand what trigger is causing it NOT to remain visible.

My guess is that it has to do with navigating to other records, or if not, that's
something you should/will have to deal with. The same code that shows/hides
the subform on the AfterUpdate event of the combo must also be placed on
the Form_Current() event, so that when you land on a new record, the combo
box's value is evaluated to determine whether or not to display the subform.

I have a feeling your problem isn't that simple, but I can't quite figure out
what the real question is from this description. Post back with more detail.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top