Linking a field in one form to open a record in another form

  • Thread starter pyxi_styx via AccessMonster.com
  • Start date
P

pyxi_styx via AccessMonster.com

I'm having an issue I just can't seem to find the answers to. I hope someone
will be able to assist.

I have a main form, Customer, with a great little lookup combo and a nice
layout; including a subform tabbed area that has a tab/subform for 1)
Contracts, 2) Sites, 3) Call Numbers, and 4) Visits for that customer. Each
tab/subform is in datasheet view, of course.

What I would like to be able to do is click on a record in one of these
subforms and it open that form, to that record. (i.e. clicking contract
number 12345 will open that form to contract 12345). Any thoughts?
 
J

Jeff Boyce

Have you looked into using the OnClick event to create a procedure that
opens a form, limited to the record (ID) of the record clicked on?

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
P

pyxi_styx via AccessMonster.com

***Note*** I know I must use a OnClick Macro,but am unsure how to format it
to open it properly
 
P

pyxi_styx via AccessMonster.com

I did try that, I have my open form macro's Where condition set to
[ContractNum]=[Forms]![Contracts subform]![ContractNum]; and that works great
when doing it straight from the subform datasheet... but when I try doing it
from the Customer form, I get the dialog box saying "Enter Parameter Value
Forms!Contracts subform!ContractNum"

Which is why I'm so confused. I assumed if it worked on the subform, it
should work on the customer rendering of the subform

Jeff said:
Have you looked into using the OnClick event to create a procedure that
opens a form, limited to the record (ID) of the record clicked on?

Regards

Jeff Boyce
Microsoft Office/Access MVP
I'm having an issue I just can't seem to find the answers to. I hope
someone
[quoted text clipped - 9 lines]
subforms and it open that form, to that record. (i.e. clicking contract
number 12345 will open that form to contract 12345). Any thoughts?
 
J

Jeff Boyce

Actually, since the form that holds the selected [ContractNum] is a
SUB-form, you need to refer to the full path to that information.

It will look something like (untested):

Forms!YourMainForm!YourSubformControlName.Form![ContractNum]

Good luck!

Regards

Jeff Boyce
Microsoft Office/Access MVP

pyxi_styx via AccessMonster.com said:
I did try that, I have my open form macro's Where condition set to
[ContractNum]=[Forms]![Contracts subform]![ContractNum]; and that works
great
when doing it straight from the subform datasheet... but when I try doing
it
from the Customer form, I get the dialog box saying "Enter Parameter Value
Forms!Contracts subform!ContractNum"

Which is why I'm so confused. I assumed if it worked on the subform, it
should work on the customer rendering of the subform

Jeff said:
Have you looked into using the OnClick event to create a procedure that
opens a form, limited to the record (ID) of the record clicked on?

Regards

Jeff Boyce
Microsoft Office/Access MVP
I'm having an issue I just can't seem to find the answers to. I hope
someone
[quoted text clipped - 9 lines]
subforms and it open that form, to that record. (i.e. clicking contract
number 12345 will open that form to contract 12345). Any thoughts?
 
P

pyxi_styx via AccessMonster.com

I have changed my macro code to say [ContractNum]=[Forms]![Customer]![Forms]!
[ContractsSubform]![ContractNum], but still get the same error dialog box
(except it now includes the updated stuff).


Jeff said:
Actually, since the form that holds the selected [ContractNum] is a
SUB-form, you need to refer to the full path to that information.

It will look something like (untested):

Forms!YourMainForm!YourSubformControlName.Form![ContractNum]

Good luck!

Regards

Jeff Boyce
Microsoft Office/Access MVP
I did try that, I have my open form macro's Where condition set to
[ContractNum]=[Forms]![Contracts subform]![ContractNum]; and that works
[quoted text clipped - 20 lines]
 
P

pyxi_styx via AccessMonster.com

Got it. Thanks a ton for all of your help! You are fantastic... my career
thanks you!

Ambyr
 

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