findrecord not allowed in subform

J

jaman57

I have a form with a subform. The form contains information about publication
deficiency reports, which can apply to more than one publication. The form
("controlnumber") is based on table "controlnumber" and the form I use as the
subform ("pubfomm") is based on table "pub". I have a primary key in the
"controlnumber" table called "reportcontrolnumber", which joins to the field
"rcnref" in the "pub" table. I have set the master and child fields between
the form and subform, which works fine - when I go to the subform the data in
the "reportcontrolnumber" field appears correctly in the "rcnref" field in
the subform.
Now to the problem. The table "pub" contains a list of pubs with associated
information (like person responsible) and each pub can only appear once in
the pub table (I use "pub number" as the primary key in the "pub" table). In
the subform I have a combo box called "Combo 9" which is used to select the
pub that applies - the idea is to select that pub and populate the subform
with the associated information. To the "after update" property of "Combo 9"
I have the following simple code:

DoCmd.GoToControl "Pub Number"
DoCmd.FindRecord [Combo9]

If I open the "pub" form by itself this works perfectly - it finds the
record and populates the fields. But in the subform, when I use the combo box
in the same way, I get the error message "Run-time error 2137. You can't use
find or replace now". I have racked by little brain trying to find a way to
make this work. Why doesn't it work, and what can I do to accomplish what I'm
trying? Remember, I will need to go to another record in the subform
referring back to the same control number to fill in info about another pub.
I want a combo box because it is important that the user can only select from
the list of pubs, not type it in by themselves.

Who can help?

Thanks,
Jeff
 
Top