Requerying Subform

G

Guest

I am very stumped. I have read through many postings and can't get mine to
work. I have a main form that has information on each property. Each
property has an OwnerID which links to the primary key in the Owners table.
There is a one to many relationship set up between the table. One owner can
have many properties. I have a main form where the user can select the
owner from the combo box. In a subform the selected owner information should
be displayed. Hoewevr I cannot get this information to update when the user
makes a change to the selected ownerID. I have linked the master and child
fields to the OwnerID fields. Also in the After Update event of the main
form of the ownerID I have:

Me.subOwner.Form.Requery

subOwner is the sub form displaying the owner info. The only way it will
refresh is if I select a new owner, click on the sub form and the select a
new owner. I've tried everything. Any suggestions would be greatly
appreciated, Thanks,
Blair
 
G

Guest

Dear Blair,

I suggest you to ensure that the Data Entry is not set to Yes. I created two
tables and set 1 to many relationship. Created a main with OwnerID box and a
subform with Property box. Tried the input and edit. Have no problem. If you
envisage same problem, please forward to me the database at
(e-mail address removed).
 
D

Dirk Goldgar

Blair said:
I am very stumped. I have read through many postings and can't get
mine to work. I have a main form that has information on each
property. Each property has an OwnerID which links to the primary
key in the Owners table. There is a one to many relationship set up
between the table. One owner can have many properties. I have a
main form where the user can select the owner from the combo box.
In a subform the selected owner information should be displayed.
Hoewevr I cannot get this information to update when the user makes a
change to the selected ownerID. I have linked the master and child
fields to the OwnerID fields. Also in the After Update event of the
main form of the ownerID I have:

Me.subOwner.Form.Requery

subOwner is the sub form displaying the owner info. The only way it
will refresh is if I select a new owner, click on the sub form and
the select a new owner. I've tried everything. Any suggestions
would be greatly appreciated, Thanks,
Blair

What are the following properties of the forms and controls:

Main form's RecordSource

Name of owner combo box on main form

ControlSource of owner combo box on main form

Subform's RecordSource

Link Master Fields property of subform control

Link Child Fields property of subform control

?
 
G

Guest

Hi thanks for the responses, my subform is set for No Data entry. Here is
my info:
 
D

Dirk Goldgar

Blair said:
Hi thanks for the responses, my subform is set for No Data entry.
Here is my info:

The Link Master Field property of the subform control should be
"cboOwnerID", not "OwnerID" -- that is, it should be the name of the
control on the form, not a field in the form's recordsource. See if
making that simple change, and removing the unnecessary requery in the
control's AfterUpdate event, fixes your problem.
 

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