G
Guest
Hello, All.
First let me say: I've gotten lots of good information in these discussion
groups. I've been working with Access for all of 3 months and in general it
seems that everybody follows a similar learning curve. So lots of my
questions have been addressed. The responders are patient beyond belief from
what I've read. So thanks in advance.
Question is: I have a main form with 2 subforms (both always present on a
tab control). It is not necessarily the case that there is any data to
populate the subfoms; therefore the SQL is:
tableA as A left join tableB as B on A.ticketID = B.ticketID
(for both subforms). This SQL works fine when executing from SQL View.
However, when I try to open the main form, it seems that (at least one of)
the subforms opens before the main form (I have debug.print "FormName_Open at
" & Now statements in the form open procs to trace the sequence). This causes
some problems, since the subforms depend on the value of TicketID in the main
form to determine which records to select. Since the recordset for the main
form hasn't opened yet, VBA complains that the ADO Recordset object is
closed, so I can't check for a populated master recordset before spending
time trying to retrieve records that I shouldn't be retrieving.
Any suggestions for 1) a cleaner way of coding this that avoids the
dependency? Or 2) how to design this better?
TIA
First let me say: I've gotten lots of good information in these discussion
groups. I've been working with Access for all of 3 months and in general it
seems that everybody follows a similar learning curve. So lots of my
questions have been addressed. The responders are patient beyond belief from
what I've read. So thanks in advance.
Question is: I have a main form with 2 subforms (both always present on a
tab control). It is not necessarily the case that there is any data to
populate the subfoms; therefore the SQL is:
tableA as A left join tableB as B on A.ticketID = B.ticketID
(for both subforms). This SQL works fine when executing from SQL View.
However, when I try to open the main form, it seems that (at least one of)
the subforms opens before the main form (I have debug.print "FormName_Open at
" & Now statements in the form open procs to trace the sequence). This causes
some problems, since the subforms depend on the value of TicketID in the main
form to determine which records to select. Since the recordset for the main
form hasn't opened yet, VBA complains that the ADO Recordset object is
closed, so I can't check for a populated master recordset before spending
time trying to retrieve records that I shouldn't be retrieving.
Any suggestions for 1) a cleaner way of coding this that avoids the
dependency? Or 2) how to design this better?
TIA