Subform Bug

S

Sqt_Squirrel

Hi all,

I have a wierd issue that I cannot seem to solve.


I am developing a DB; one of the forms [Office] has a subform that lists all
records from [Employee] where the Office_ID = that of the current record.
The solution has been sucessful until now. The subform is now not returning
any values unless the DB is launched whilst pressing the Access hotkey. I
believe the subform is still physically there, it is simply not viable on
the form.

Any thoughts?


Regards,

Cpl_Bear
 
S

Sqt_Squirrel

Thank you to Golfinray for his reply; however, this is not the issue.

I have found that if I launch the form by DoCmd.Openform "FormName", , , ,
acDialog then the problem does not occur; previously, I was using my
prefered method of DoCmd.Openform Form_FormName.Name, , , , acDialog anyone
know what the issue could be?


Many thanks,

Cpl_Bear.
 
D

Dirk Goldgar

Sqt_Squirrel said:
Thank you to Golfinray for his reply; however, this is not the issue.

I have found that if I launch the form by DoCmd.Openform "FormName", , , ,
acDialog then the problem does not occur; previously, I was using my
prefered method of DoCmd.Openform Form_FormName.Name, , , , acDialog
anyone know what the issue could be?


You really need to change your preferred method for opening forms -- it
doesn't do what you think it does.

Any reference to the form's class module -- which you are doing with the
syntax, Form_FormName -- causes that form to be opened, if it isn't already
open. Furthermore, when that happens, it is opened hidden, and as a
non-default instance (not indexed by name in the Forms collection).

So what your code is doing is first opening a non-default instance of the
form (by referring to its class module's Name property), and then opening a
second instance of the form, this time in dialog mode. I don't see your
original discussion thread, so I don't know what problem you're experience,
but I imagine that it's related to this sequence of events.
 

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