Is this clearer, or is it what you thought in the first place, and is not an
easy task?
All of the above <g>
That is a bit clearer, and its along the same lines as what I had thought,
and I still don't think it would be a lot of fun, for the same reasons as my
previous post.
The "standard" way to do this would be to open the detail form in Dialog
mode, from either a button or a double click in the summary field(s), let the
user edit the details, and then they close the form and move on. This keeps
things fairly straightfoward.
I don't really see any reason why you couldn't do it the way that you'd like
to, but it will be a lot more work. I've never done it before, and there may
be a few snags I'm not thinking of at the moment, but it seems feasible.
Here's a little quick-start quide:
In the button to open the form, pass the currently selected record's ID as
an openarg (the last argument in the DoCmd.OpenForm method).
Then, in the Open event of the detail form, read the OpenArg (Me.OpenArgs)
to get the ID that you need to link to, and filter the form to show that
record(s).
In the Current event of the main form, you'll want to change the
recordsource of the detail form and requery it. Something along the lines of:
Forms![DetailFormName].Recordsource = _
"SELECT * FROM <table> WHERE [ID] = " & Me.ID
Forms![DetailsFormName].Requery
I'm not positive of that syntax, for example use only
Before trying to change the recordsource, we should make sure that the
detail form is open. I have an IsFormOpen() function buried away somewhere I
can dig up if need be.
Also, it would be prudent to close the detail form if it is opened when the
summary form is opened. This is easily enough accomplished using the
DoCmd.Close method (after making sure that the form is indeed open).
That covers the basics of what I had in mind....
--
Jack Leach
www.tristatemachine.com
"I haven''t failed, I''ve found ten thousand ways that don''t work."
-Thomas Edison (1847-1931)
MikeF said:
Jack,
Perhaps you're reading more into this than is intended.
Form1 is merely a summary form.
Form 2 contains the details.
So if Form1 is actually frmCompany - which has a Company name; and Form2 is
actually frmCompanyDetail, which has the company's address/phone/city/etc.
That way I don't have to store all the details in an already-crowded summary
form, but have easy access to them - via a button - if necessary.
There's never the same data in frmCompanyDetails that would need to be
changed in frmCompany.
At least not the ID field.
Is this clearer, or is it what you thought in the first place, and is not an
easy task?
- Mike