Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Reference to field on Subform from Subform2 no longer works?

Status
Not open for further replies.

Poduska

Technical User
Dec 3, 2002
108
US
I have a form with 2 subforms which worked GREAT until I moved it from my notebook with only Access 2003 to another PC with Access 2003 and Access 97 (transitioning to 2003 slowly).

I can reference the field value in Subform1 using the debug window (examples below) but the source query for Subform2 cannot seem to find a value and it comes up blank. But this all works find on the Access 2003 only PC.

As a mock up I used Northwinds DB and the Products table. So i have,

main form = [frmSuppPartsBrowse] which has a combo box by Category

SubForm 1 = [fsubParts] which is a listing of products from main for combo box - This works fine.

Subform 2 = [frmtblSuppParts subform] which is a datasheet form based upon a query of a table of data concerning the item selected in fsubparts by ProductID (i.e. in Northwinds 34 is Sasquatch Ale)

When you double click on the ProductID in [fsubparts] this opens a little popup which allows the user to key the data that is saved into the table which SHOULD show up in [frmtblsuppparts] (subform2). When you leave the popup by cmd button then [frmtblsuppparts] (subform2) requeries and the data you just entered in the popup shows up in [frmtblsuppparts] (subform2). BUT ONLY ON MY NOTEBOOK!!!!

If I just enter the productID i.e 34 as the source criteria for [frmtblsuppparts] then the subform populates fine every time I add new data via the pop up form but if I utilize the reference to my first subform field this results in nothing being returned by my source query for [frmtblsuppparts](subform2).

If I key the same query criteria into the debug window it returns data, for example.

Code:
?[Forms]![frmSuppPartsBrowse]![fsubParts]![productID]
 34 
?[Forms]![frmSuppPartsBrowse].[fsubParts]![productID]
 34 
?[Forms]![frmSuppPartsBrowse].[form]![fsubParts]![productID]
 34

Each returns 34 and if I put 34 in my query it returns data but if I place the criteria from the Debug window nothing comes back.

It this caused by having 97 and 2003 or it there something else wrong? I checked References and all are the same.

I can upload source file tonight but cant from work.

Thanks for any insight someone might be able to offer.

David


 
I spent an hour making sure the post was clear and readable and after I posted it I then opened another post only to find that I was missing the bold part below which makes the entire thing work.

[Forms]![frmSuppPartsBrowse]![fsubParts] .[Form] ![ProductID]

Still don't know why the debug window returned a value but not the subform. Oh well.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top