Sorry, I didn't intend to come across as "upset". If
anything, I am felling frustration in my attempt to
understand what you need here.
I think your current difficulty may be that you need to
replace the names I used with the names you actually have in
your form and table:
Replace Member ID by the name of the field in the
table/query that is the record source of the "other" form
we're trying to open.
Replace txtMemberID with the name of the text box control on
the members form that is bound to the member ID field in the
table.
Note Rick's comment about names with spaces or other funky
characters.
It facilitates communication if you use the exact names of
whatever objects are being discussed so we don't have to
guess what object you are referring to and you don't have to
figure out what our guesses mean to you. Another thing that
helps us help you is if you use Copy/Paste whenever posting
any code or query SQL statements. This way we we will not
have to waste time debugging typos.
As for experimenting with a subform, it is very easy.
First, make a copy of the two forms so you can undo any
false starts. (Just use Copy/Paste in the database window.)
Then drag the "other" form and drop it in the form footer
(not page footer) or detail section of the members form.
Check to make sure that the subform control's Link
Master/Child properties contain the names of the member id
field in the two tables. That's all there is to it, no code
at all.
Sorry Marshall, i did not mean to upset you. It is my ingorance you are
dealing with here not my attitude.
I tried the code you posted but it gets stuck on & Me.txtMemberID.
i am trying to figure out why at the moment. i think it has something to do
with the name of my Member ID field name but if i use 9& Me.txtMember ID that
fails as well.
Your suggestion on sub forms opens another area of unknowns for me.
I will investigate that approach.
This is a learning experience for me, please keep that in mind when you get
frustrated with some of my replies.
:
I don't understand. The code I posted will open some other
form (based on the "sub table") to the same ID as the
currently selected record in the members form. What about
this don't you like?
Actually, the usual approach to this kind of thing is to use
a subform instead of opening another form. Have you
investigated this scenario and rejected it? If so, why?
The only other interpretation I can put to your question is
that you want to open 10(?) copies of the other form at the
same time. This doesn't make a lot of sense to me because
it would make your screen so cluttered you wouldn't be able
to see anything useful. If this is what you really want to
do, be advised that this is a fairly advanced topic that
requires a significant knowledge of VBA, collections, object
creation, and object management.
In any case, I woud need a more detailed description of what
you are trying to achieve before launching into suggestions
for an implementation.
scottjr wrote:
Pull a form does mean open a form. i can do that much so far.
This is the part i cannot get to yet.
Every memberID displayed in the search members form (each record in the
member table) requires a form to open that is attached to that memberID sub
table (Dogs).
If there are 10 members in the members table, the search members form button
would have to open 10 different forms each attached to a memberID.
memberID 33 has basic info in members table
memberID 33 has dogs owned record in the sub table linked to memberID 33
:
scottjr wrote:
i am not sure where this question should be posted. i am guessing somewhere
around here.
i have a table with detailed member information (memberID name, address,
etc.) each member ID has a sub table that has additional info about that
member ID.
i have a form that searches members by last name and displays some of the
fields from the membership table.
I would like to add a button on the form that will pull a form showing the
sub table info related to the member ID record currently displayed.
I have added a button that will pull a sub form unrelated to the member ID
displayed but i am stuck there.
Assuming "pull a form" really means open a form, just use
the OpenForm method's WhereCondition argument:
Dim strWhere As String
. . .
strWhere = "[Member ID] = " & Me.txtMemberID
. . .
DoCmd.OpenForm . . ., WhereCondition:=strWhere