Subform not performing requery properly

D

darken4978

Hello,

The problem I am having is that the Subform I have embedded in my Main
form is not requerying its recordsource query properly (from what I
can tell). Here is the setup:

As mentioned above, I have a Main form with a Subform embedded in it.
The Main form's RecordSource is a table. The Subform's RecordSource is
the following query:

SELECT COTS_Item_Defs.*, INFO_Media_Types.IMT_NAME,
INFO_Vendor_List.IVL_VENDORNAME
FROM INFO_Vendor_List INNER JOIN (INFO_Media_Types INNER JOIN
COTS_Item_Defs ON INFO_Media_Types.IMT_ID = COTS_Item_Defs.CID_IMT_ID)
ON (INFO_Vendor_List.IVL_ID = COTS_Item_Defs.CID_IVL) AND
(INFO_Vendor_List.IVL_ID = COTS_Item_Defs.CID_IVL)
WHERE (((COTS_Item_Defs.CID_ID)=[forms].[Full_Data_Exp].
[CII_CID_ID]));

The two primary tables being worked with are the COTS_Item_Defs table
and the COTS_Item_Instances table. The purpose of these tables is to
reduce entry redundancy as there are numerous unique instances of each
item, but aside from some specific differences (like serial numbers) a
number of properties are essentially the same. On the Main form there
is a ComboBox control that allows the user to select which type of
item they are adding a new entry for, derived from the COTS_Item_Defs
table; the CBO has two columns: the bound column is the unique
identifier for the record in the underlying table, and the second
displays the text description of the Item Definition. The Subform is
meant to display more detailed information based upon the users'
selection in the ComboBox on the Main form. All data on the Main form
is being entered into the COTS_Item_Instances table, which contains
the foreign key linking each record to a record in the COTS_Item_Defs
table. The ComboBox is bound to this field.

To accomplish this, I had the Subform's Requery method called on the
CII_CID_ID's ComboBox AfterUpdate's event. This worked fine - until I
went back to the COTS_Item_Defs table and changed a field's Required
property to 'Yes', and its Indexed property to 'Yes (No duplicates)'.
Now, the Subform does not seem to be performing the Requery on its
RecordSource query (above). At the same time, if I open the query from
the database window it properly displays the record selected by the
ComboBox selection.

Things I have tried:

Returning the field's Required and Indexed properties to their
original values.
Rebuilding the query that is the Subform's RecordSource
Manually setting the Subform's RecordSource to the SQL of the query
Manually Requerying the Recordset after a selection has clearly been
made
Invoking the Refresh and/or Repaint methods along with Requery

Any help or insight would be appreciated!
 
D

darken4978

Hello,

The problem I am having is that the Subform I have embedded in my Main
form is not requerying its recordsource query properly (from what I
can tell). Here is the setup:

As mentioned above, I have a Main form with a Subform embedded in it.
The Main form's RecordSource is a table. The Subform's RecordSource is
the following query:

SELECT COTS_Item_Defs.*, INFO_Media_Types.IMT_NAME,
INFO_Vendor_List.IVL_VENDORNAME
FROM INFO_Vendor_List INNER JOIN (INFO_Media_Types INNER JOIN
COTS_Item_Defs ON INFO_Media_Types.IMT_ID = COTS_Item_Defs.CID_IMT_ID)
ON (INFO_Vendor_List.IVL_ID = COTS_Item_Defs.CID_IVL) AND
(INFO_Vendor_List.IVL_ID = COTS_Item_Defs.CID_IVL)
WHERE (((COTS_Item_Defs.CID_ID)=[forms].[Full_Data_Exp].
[CII_CID_ID]));

The two primary tables being worked with are the COTS_Item_Defs table
and the COTS_Item_Instances table. The purpose of these tables is to
reduce entry redundancy as there are numerous unique instances of each
item, but aside from some specific differences (like serial numbers) a
number of properties are essentially the same. On the Main form there
is a ComboBox control that allows the user to select which type of
item they are adding a new entry for, derived from the COTS_Item_Defs
table; the CBO has two columns: the bound column is the unique
identifier for the record in the underlying table, and the second
displays the text description of the Item Definition. The Subform is
meant to display more detailed information based upon the users'
selection in the ComboBox on the Main form. All data on the Main form
is being entered into the COTS_Item_Instances table, which contains
the foreign key linking each record to a record in the COTS_Item_Defs
table. The ComboBox is bound to this field.

To accomplish this, I had the Subform's Requery method called on the
CII_CID_ID's ComboBox AfterUpdate's event. This worked fine - until I
went back to the COTS_Item_Defs table and changed a field's Required
property to 'Yes', and its Indexed property to 'Yes (No duplicates)'.
Now, the Subform does not seem to be performing the Requery on its
RecordSource query (above). At the same time, if I open the query from
the database window it properly displays the record selected by the
ComboBox selection.

Things I have tried:

Returning the field's Required and Indexed properties to their
original values.
Rebuilding the query that is the Subform's RecordSource
Manually setting the Subform's RecordSource to the SQL of the query
Manually Requerying the Recordset after a selection has clearly been
made
Invoking the Refresh and/or Repaint methods along with Requery

Any help or insight would be appreciated!

Update:

Clearing the LinkMasterFields and LinkChildFields properties returned
the behavior to normal. What's ironic to note at this point is that
these two properties were originally meant to perform the task I
needed - although, after removing the Criteria from the query design,
it still did not work properly. At any rate, the problem has been
solved.
 

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