Open Datasheet from Sub Form

  • Thread starter MiHutch via AccessMonster.com
  • Start date
M

MiHutch via AccessMonster.com

This may take a little to explain, but I hope I can get you to understand my
setup.

I have a sub form which shows a list of records assigned to a user. This list
is filtered by selecting a person from a combo box on the main page. I used a
Link Master/Child field on the sub form to get this to work. I have several
columns in the sub form that I would like to double click on and it will open
a new form. I was able to setup the first column to open a form on the
selected item in form view.

My problem is I have a column which shows a persons name, I want to double
click on the name and open a new form in datasheet view. I want to display
all records with this persons name in datasheet form.

When I double click now I get, "Enter Parameter Value". When I manually type
in a persons name it opens the correct form and displays all records with the
persons name.

If I close the main form and open the sub form by itself and double click on
a record in the person column it opens the form and filters the correct
records by itself.

I have the following line in the criteria line of my query, [Forms]!
[Unassigned Sub Form]![sales_person]

What am I missing? Does the Master/Child have anything to do with this?

Thanks for any help you can lend me.

MiHutch
 
T

Tom van Stiphout

On Thu, 01 Oct 2009 04:28:23 GMT, "MiHutch via AccessMonster.com"

You got that criteria line wrong. To access a control in a subform
use:
Forms!myForm!mySubformControlName.Form!myControlInSubform
(of course you replace myObjectNames with yours)

-Tom.
Microsoft Access MVP
 
M

MiHutch via AccessMonster.com

Worked great, I knew I forgot something. I guess I was trying to bypass the
main page and use the subform only.

Thanks
MiHutch
You got that criteria line wrong. To access a control in a subform
use:
Forms!myForm!mySubformControlName.Form!myControlInSubform
(of course you replace myObjectNames with yours)

-Tom.
Microsoft Access MVP
This may take a little to explain, but I hope I can get you to understand my
setup.
[quoted text clipped - 26 lines]
 
T

Tom van Stiphout

On Thu, 01 Oct 2009 15:45:57 GMT, "MiHutch via AccessMonster.com"

If your code is on the mainform, you can certainly abbreviate the
expression:
Me.mySubformControlName.Form!myControlInSubform

-Tom.
Microsoft Access MVP

Worked great, I knew I forgot something. I guess I was trying to bypass the
main page and use the subform only.

Thanks
MiHutch
You got that criteria line wrong. To access a control in a subform
use:
Forms!myForm!mySubformControlName.Form!myControlInSubform
(of course you replace myObjectNames with yours)

-Tom.
Microsoft Access MVP
This may take a little to explain, but I hope I can get you to understand my
setup.
[quoted text clipped - 26 lines]
 

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