By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,224 Members | 1,201 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,224 IT Pros & Developers. It's quick & easy.

How to look-up a read-only subform via a linked field in a form...

P: n/a
Hey all. if anyone is REALLY bored please help moi. I am new to
access stuff and am probably missing something obvious here.
I have 2 tables that are linked via "number" in the relationship area.
The relationship is many to many. One is a master form and the other
I dragged in to be a subform. I also created a child/master link
based on the common "number" field. So, it's a generic subform pretty
much.

What works: when I scroll through the entries, the main form and the
subform are in sync and the data reads out fine.

What doesn't work: what I really want to be able to do is use the
subform as a read only form such that on the main form when I create a
new entry and type something into "number", I will immediately be able
to see the contents of the corresponding subform (there are several
contents per "number" as the relationship is many to many). But,
instead what happens is that a new value is created in the subform
that is empty. What is interesting though is if I then afterwards
create another entry in the main form, then go BACK to the previous
entry, the subform is updated and all of the child entries are stored
there (including the empty one I just created).

The reason why a new entry in the subform is created is because I was
trying a requery statement attached to "number" on the main form:
Private Sub Number_AfterUpdate()
Me."Subform name".Requery
End Sub

- so this is on the right track but as it immediately looks up the
number field in the subform but it creates a blank entry and doesn't
simply look-up the info.

Also, Is there any way to lock a subform only as when I make the
subform properties set to lock, it locks the actual form itself too...

Thanks for any suggestions....................................... .....
Nov 12 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.