I'm wondering if someone can shed some light on a problem that I am baffled by.
I have a main form (frmTherapy) within which are 8 hidden subforms. Each subform becomes visible depending on user selection. One of these subforms is called sbfrmTracheostomy. It collects information about the patient's tracheostomy, including the tracheostomy tube. A combobox (cboTracheostomyBrand) displays various trach brands from a lookup table. Depending on the brand of trach, the second combobox (cboTracheostomyType) lists various tubes sold by that company. This second combobox is populated by another lookup table which contains TrachTypeID, TrachName and PicturePath (the path to images for each trach tube). I put the following code: Me!MyPicture.Picture = Me!PicturePath in the cboTrachType AfterUpdate event. This all works fine. In order for the image to be displayed when the form is loaded, I placed this same line of code in the Form's OnCurrent event.
Here's my problem: on the main form "frmTherapy", when any subform other than the tracheostomy subform is chosen by the user, I'm getting the error "Type Mismatch" a total of 3 times. When I remove the line: Me!MyPicture.Picture = Me!PicturePath from sbfrmTracheostomy's Form_Current event, everything works fine, except that the picture is not displayed on the tracheostomy subform anymore. I can't figure out why this particular code in this one subform's OnCurrent event is affecting loading of all other subforms.
Is there something I'm overlooking?
Thanks for any help.