Linking subforms

M

Mike

Im having dificulty getting 2 linked subforms to operate
correctly. I have a main contact form and a subform#1
thats is a list of pending actions for that customer. the
2nd subform is a detail of the selected action in
subform#1. I setup sub#1 as a child to the main form via
the customerID, I set up sub#2 as a child to sub#1 using
the actionID, Im using the OnCurrent event for Sub#1 to
requery Sub#2. This is very similar to the Customer
Orders forms in the Northwinds db. Everything works
except when I try to add a new record to Sub#2. WHen I
enter the 1st letter in any field I get an information
box saying "You cant Assign a value to this object" and
suggests that the form is read-only, the form is in
design mode, or the text is too long... After I clear the
dialog box, the form works fine and accepts all data.
This only occurs on new records. any suggestions would
be greatly appreciated.. Mike
 
P

PC Datasheet

Mike,

Add a hidden textbox named MyTextbox to the main form. Set the LinkMaster
property of the second subform to [MyTextBox] and the LinkChild property to
ActionID. Put this code in the OnCurrent event of the first subform:

Me.Parent!MyTextbox = Me!ActionID
 

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