Unpredictable results with two subforms

Ö

Ömer Ayzan

Dear friends,

I'am a user of office 2003. I have the following tables in one to many
relationship.
tblCategory which is the one table and has got the fields:
CategoryID Auto
CategoryCode Text (2)
Category Text(20)
Second table is: tblMatrlSort and has these fields
MatrlSortID Auto
CategoryID Long
MatrlSortCode Text(2)
MatrlSort Text(20)

I created a contious form for each of these tables and placed them as
subforms on a third form which is unbound.
Main idea is to show respective records whenever a record on one of the
subforms (which is for the one side) is selected.
On the main form I placed a textbox (txtCategoryID) which is used to link
the subforms. That is, if a record is selected on the left subform,
on the current event I copy the value of the categoryID to textbox on the
mainform. For the second form the following setting are made
for linkchild fields & linkmasterfields:
linkchild fields = categoryID
linkmasterfields=txtCategoryID

So far so good. Whenever a record is selected on the left side respective
records are shown on the right. I use this form as a browser so I do not
want
users directly edit data in browser mode. Instead with a pop up menu they
can open a form which will allow them to edit the record that is current.
Now I have the problem. While there is no problem in editing records on the
left by means another form, the records on the right are most of the times
arbitrary.

Right subform sometimes objects to its parent property. For instance; while
the current records categoryID is 13 if I try to assign it a variable it
says it is 9.

Am I wrong in my approch by placing two continous forms on an unbound form
if so what is the better approach to get the same objective?

Thanks in advance,

Ömer Ayzan
 
J

Joan Wild

You shouldn't need to use the current event to update the value of
txtCategoryID. Just set the control source of txtCategoryID to
=Me!CategorySubform!CategoryID
substituting CategorySubform to the name of your subform control.
 

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