linking subforms

  • Thread starter Thread starter Grace
  • Start date Start date
G

Grace

Hello, I have a form that contains 2 subforms. Here is a
description of the form: The top of the form displays an
employee's name. The first subform [subformHelpDesk1]is a
datasheet view that lists all open tickets for the
employee. The second subform [subformHelpDesk2]displays
details of each ticket. A similar form in the NorthWinds
database is the Customers Orders form with the exception
that the second subform is not in datasheet view.

I am having a problem linking the two subforms. The
master field is PIN. I have linked the first subform to
the child and master field PIN. That works fine.
However, I would like the second subform to link to the
first subform using a different field [TicketNumber].
Using the Northwinds example, I set Link Master field
property to:[subformHelpDesk1].Form![TicketNumber]

The first subform displays the lsit of tickets properly.
However, I am unable to click on each record to display
the details in the second form. Any advise on what I'm
doing wrong is greatly appreciated.

Thank you.
 
Grace,

Try it like this... Put a hidden, unbound textbox on the main form,
and set its Control Source property to:
=[subformHelpDesk1].Form![TicketNumber]
Let's say you name this textbox TicketRef. So then, set the
LinkMasterFields property of subformHelpDesk2 to TicketRef.

- Steve Schapel, Microsoft Access MVP
 
I'm glad to know I'm not the only one having this problem.
I, too, followed the Northwind.mdb example. It didn't work
on my form (although it works in Northwind -- I tried it!)

Thank you, Steve, for your workaround. It does the job.

Now, can anyone tell us why Microsoft's suggestion doesn't
work?? It's very frustrating when you follow the example
and it doesn't work. What are we missing???
-----Original Message-----
Grace,

Try it like this... Put a hidden, unbound textbox on the main form,
and set its Control Source property to:
=[subformHelpDesk1].Form![TicketNumber]
Let's say you name this textbox TicketRef. So then, set the
LinkMasterFields property of subformHelpDesk2 to TicketRef.

- Steve Schapel, Microsoft Access MVP


Hello, I have a form that contains 2 subforms. Here is a
description of the form: The top of the form displays an
employee's name. The first subform [subformHelpDesk1]is a
datasheet view that lists all open tickets for the
employee. The second subform [subformHelpDesk2]displays
details of each ticket. A similar form in the NorthWinds
database is the Customers Orders form with the exception
that the second subform is not in datasheet view.

I am having a problem linking the two subforms. The
master field is PIN. I have linked the first subform to
the child and master field PIN. That works fine.
However, I would like the second subform to link to the
first subform using a different field [TicketNumber].
Using the Northwinds example, I set Link Master field
property to:[subformHelpDesk1].Form![TicketNumber]

The first subform displays the lsit of tickets properly.
However, I am unable to click on each record to display
the details in the second form. Any advise on what I'm
doing wrong is greatly appreciated.

Thank you.

.
 
Jan,

Good question. The Northwind example has code on the On Current event
of the first subform, to Requery the second subform. This works, but
it is not my preferred way of doing it.

- Steve Schapel, Microsoft Access MVP
 
Thanks Steve! That did work great. I even copied that
code on the On Current event and it still didn't work.
YOur suggestion works great.

However, now I am having problems creating new records in
the detailed subformHelpDesk2. I have a New Record button
that I created using the wizard (it used to work) but now
it doesn't. I activated the Record Selector and it won't
let me create a new record. It will flash a new
TicketNumber (which is set to AutoNumber) and then go back
to the record that is selected in subformHelpDesk1.

Thanks again for your help -

Grace
-----Original Message-----
Grace,

Try it like this... Put a hidden, unbound textbox on the main form,
and set its Control Source property to:
=[subformHelpDesk1].Form![TicketNumber]
Let's say you name this textbox TicketRef. So then, set the
LinkMasterFields property of subformHelpDesk2 to TicketRef.

- Steve Schapel, Microsoft Access MVP


Hello, I have a form that contains 2 subforms. Here is a
description of the form: The top of the form displays an
employee's name. The first subform [subformHelpDesk1]is a
datasheet view that lists all open tickets for the
employee. The second subform [subformHelpDesk2]displays
details of each ticket. A similar form in the NorthWinds
database is the Customers Orders form with the exception
that the second subform is not in datasheet view.

I am having a problem linking the two subforms. The
master field is PIN. I have linked the first subform to
the child and master field PIN. That works fine.
However, I would like the second subform to link to the
first subform using a different field [TicketNumber].
Using the Northwinds example, I set Link Master field
property to:[subformHelpDesk1].Form![TicketNumber]

The first subform displays the lsit of tickets properly.
However, I am unable to click on each record to display
the details in the second form. Any advise on what I'm
doing wrong is greatly appreciated.

Thank you.

.
 
Back
Top