Form, subform, combo.. the problem is unclear!

jim84

Registered User.
Local time
Today, 21:23
Joined
Nov 4, 2002
Messages
23
OK, problems! im right at the very end of my project and all of a sudden this little beauty pops up. Typical! I have 2 days to finish it so would really appreciate any advice or help!! :)

----------------------------------------------------------

Ill start with background info:

# The 2 parent Tables involved = Staff and IT Equipment

# The Key field in Staff = username
The Key field in IT Equipment = TAG

# Both these have child fields in a 'child Table' called Staff-Rooms-Equipment (SRE). So within SRE there is a child username field (the many in a one2many) and a child TAG field (the many in a one2many)

# All relationships have "Enforce Differential Integrity" turned on.


----------------------------------------------------------

So I have 2 forms "Edit IT Equipment" and "Edit Staff". In essence these 2 are built the same. The problem is one works the other doesn't!

The "Edit Staff" form works perfectly and is set up as follows:

The user selects the username (parent) from a Combo Box. This populates the text boxes relevent to the selection i.e. 'First Name', 'Surname'.

A sub form also populates and within this are all the child fields from SRE i.e 'Building', 'Room' and in this case 'TAG'. (The subform is linked to the form Parent:username - Child:username)

Now the user can edit the data in this subform and it saves accordingly in SRE. If the selected username has no present record in the subform the user can type one in and it saves it completed in SRE. Perfect!


Sadly the "Edit IT Equipment" form doesn't work as well!

Its the same set up as before. The user selects the TAG (parent) from a Combo Box. This populates the text boxes relevent to the selection i.e. 'Item Description', 'Type'.

The sub form also populates and within this are all the child fields from SRE i.e 'Building', 'Room' and in this case 'username'. (The subform is linked to the form Parent:TAG - Child:TAG)

The user can edit the current data in this subform and it saves the update accordingly in SRE.

##BUT##

If the selected TAG has no present record in the subform and the user types one in it DOESN'T save it properly in SRE.

Upon closer inspection I've noticed that it does save this newly typed record in SRE but with the TAG field blank. Its therefore no good as it'll never relate this new record to the TAG is was intended for.

I've no idea why this is. In the "Edit Staff" form it saves the new subform record in SRE including the username that was selected so why in the "Edit IT Equipment" does it save new subform records in SRE but NOT INCLUDE the TAG that was selected?

I've looked at the Combo box, the subform, the form itself, the table, the relationships, the coding... EVERYTHING!!!!! but both the "Edit Staff" and "Edit IT Equipment" look to me pretty much identical.

Im now a bit blank, Im just hoping im missing something really obvious!! If anyone can offer any advice I'd very much appreciate it!

Thanks in advance, Jim.
 
What I'd check first in design view is the data tab of the property sheet of the offending subform control. Make sure the LinkChildFields and LinkMasterFields properties of the subform control are leveraging the ID field that you expect.
 
Yeh these are fine, unfortunately.

The form has no trouble finding the correct child records its just when trying to add new ones via the subform. As i said before it doesn't link the records you type in to the TAG you've previously selected.
 
Don't know. If everythings identical. One option is post the DB. Someone might be able to find the problem.
 

Users who are viewing this thread

Back
Top Bottom