Message for Steve Schapel

P

Peppie

Hi Steve,

Your help was much appreciated, but your solution lead to a new
question.

I can add new projects to my clients. I can also add new contact
persons to clients. But sometimes, the details of a contact
person change. Is it possible to select a record in the subform
and then program a button that opens an edit contact form where
the selected contactperson is already selected and ready for
edits? I do not want to allow eddits in the subform, because
this subform only shows limited information. I tried to set a
default value of ContactID field in the Edit contact form as
such: [forms]![Contacts subform]![ContactID] but that did not
work. It opens the form, but it does not show the selected
record. It always show the first record that is in the Contact
table.

Do you know how to solve this problem?

Thanks in advance, Peppie
 
S

Steve Schapel

Peppie,

If you are using an OpenForm action in your macrto to open the Contacts
form, use the Where Condition argument in the macro. It will look like
this...
[ContactID]=[Forms]![Clients]![Contacts subform]![ContactID]
 
P

Peppie

Steve wrote:

Peppie,

If you are using an OpenForm action in your macrto to open the
Contacts
form, use the Where Condition argument in the macro. It will
look like
this...
[ContactID]=[Forms]![Clients]![Contacts subform]![ContactID]

Hi steve,

Thanks for your reply and it works. Allthough, when I hit the
edit-button that I created it asks me to enter the ContactID.
Unfortunately, I have added this column, but I also hid it (all
these numbers are too distracting). So isn't it possible to
automatically select the ContactID of the selected record in the
sub form when opening the edit-form?

Thanks, Peppie
 
S

Steve Schapel

Peppie,

It shouldn't make any difference whether the ContactID control is hidden
or not. If you are being prompted for the value, then it means there is
a mistake in the Where Condition expression, probably a spelling error.
Check the name of the main form (I have assumed "Clients"), the name
of the subform control on the main form (I have assumed "Contacts
subform"), and the name of the hidden ID control (I have assumed
"ContactID").
 

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