Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

What I am doing wrong? 1

Status
Not open for further replies.

MikeRBS

IS-IT--Management
Apr 15, 2004
81
0
0
GB
I have a table of people. I view this through a query People Maintain.

I created a simple form People Maintain Subform. In design this works fine in either datasheet view or a form view.

I drop this subform onto another form Maintain People. This now works fine but I can see no way of influencing how the subform is displayed. It appears by default as a datasheet (which is what I originally intended). This it claims is form view. If I try to select datasheet view all I get is a cross in the corner of the screen.

Anyway what I then try to do is, for any given line in the subform, I would like to click something and get a full form view – not all the data fits on one line.

So I create another form People Maintain Detail, based on the same query. This works fine. Now to connect everything.

I go back to Maintain People and go into design view. This shows the subform as it would be in form view. I create an event for double click on surname field . The event is a Macro:OpenForm

Form Name:people Maintain Detail

I try these options for Where:
[ID]=[Forms]![Maintain people].[ID]
[ID]=[Forms]![People Maintain subform].[ID]
[ID]=[Me].[ID]

In each case I get an Enter Parameter Value dialogue box.

What am I doing wrong? How can I connect the form to display the record I have double-clicked? Or can I somehow get the subform to show in form view?
 
Forget Macros.

In the event of the Surname column of form "People Maintain SubForm" put code

DoCmd.OpenForm "People Maintain Detail", , , "Id = " & Me.Id, acDialog

Also, a friendly piece of advice. Do not use embedded spaces in object names, adopt a naming convention eg frmPeopleMaintain

Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - UK
 
Wicked.

It errored. Didn't like acDialog, so I took that out. Now works a treat.

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top