I am making a mess of opening two instances of a form. The situation is this.
FormA is a menu, opening FormB (a continuous form showing a lot of records) modally. This can open FormC (a dialog form, opened modally), which sometimes wants to open a new copy of FormB for the purposes of selecting data to be retrieved for use on FormC. To avoid visual confusion, each form up to FormC is hiding itself when it opens the next form (me.visible = false), and each form is restoring visibility of its calling form before it closes.
When FormC opens the new copy of FormB, I've been trying to do this by
dim SomeForm as form
set SomeForm = new Form_FormB
I've tried adding SomeForm.SetFocus and SomeForm.Visible = true, but with no noticeable effect.
If I use my code directly from FormC when there is no copy of FormB already open, then I get an error that FormB can't be recognised. If I use the code from FormC reached via the original FormB, then there isn't an error, but no new form appears. Nothing happens. I assume this means that my new copy has opened (somewhere) but it isn't visible.
I think I don't understand what I'm doing, and need help. Does anyone know any good resources for learning about multiple instances of forms in access? Or is this something simple that I'm missing? Many thanks!
FormA is a menu, opening FormB (a continuous form showing a lot of records) modally. This can open FormC (a dialog form, opened modally), which sometimes wants to open a new copy of FormB for the purposes of selecting data to be retrieved for use on FormC. To avoid visual confusion, each form up to FormC is hiding itself when it opens the next form (me.visible = false), and each form is restoring visibility of its calling form before it closes.
When FormC opens the new copy of FormB, I've been trying to do this by
dim SomeForm as form
set SomeForm = new Form_FormB
I've tried adding SomeForm.SetFocus and SomeForm.Visible = true, but with no noticeable effect.
If I use my code directly from FormC when there is no copy of FormB already open, then I get an error that FormB can't be recognised. If I use the code from FormC reached via the original FormB, then there isn't an error, but no new form appears. Nothing happens. I assume this means that my new copy has opened (somewhere) but it isn't visible.
I think I don't understand what I'm doing, and need help. Does anyone know any good resources for learning about multiple instances of forms in access? Or is this something simple that I'm missing? Many thanks!