subform processing problem

M

mscertified

I have a form bound to my Issues table. The form contains a subform bound to
my client table.
Relationship Issues to Client is many to 1.
The subform retrieves data correctly for existing issues and clients.
However when I am creating a new Issue, I cant figure out how to populate
the client. For a new Issue, the subform appears completely gray. When I
click my button to choose a client the code fails with 'you cannot assign a
value to this object' - when I attempt to populate the subform fields.
When this button is clicked, I first populate the linking field in the main
form, this works but as soon as I assign a value to a subform field it fails.

If I assign the linking field to an arbitrary value in the on current event
(when me.newrecord is true), it works. But obviously I need the user to
choose the client.
 
M

Marshall Barton

mscertified said:
I have a form bound to my Issues table. The form contains a subform bound to
my client table.
Relationship Issues to Client is many to 1.
The subform retrieves data correctly for existing issues and clients.
However when I am creating a new Issue, I cant figure out how to populate
the client. For a new Issue, the subform appears completely gray. When I
click my button to choose a client the code fails with 'you cannot assign a
value to this object' - when I attempt to populate the subform fields.
When this button is clicked, I first populate the linking field in the main
form, this works but as soon as I assign a value to a subform field it fails.

If I assign the linking field to an arbitrary value in the on current event
(when me.newrecord is true), it works. But obviously I need the user to
choose the client.


I think you have kind of a catch 22 situation. The one side
record needs to exist before you create a many side record.

A more common approach is for the main form to be bound to
the one side and the subform to be bound to the many side.
This way, to create a new issue, you first select the
client, then use the subform to enter/edit the issue.
 

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