Prev: Filter on Combobox Field in Data Project
Next: Second form to navigate to record displayed in first form
From: JohnG via AccessMonster.com on 23 Mar 2010 12:08 I'm having a problem loading data in a subform. The fields in the subform and main form are not bound. I'm using MSAccess 2007 I put VBA code in the "On Load" event of the subform to get records from a table and populate the fields on the subform after the main form is opened from a previous form but I'm getting the message: " MSAccess can't find the form referenced in the VBA code" (referring to the subform, mysubform) . As a test, I put the code to populate the subform (including, as the first line of the code, "DoCmd.Openform "mysubform") in the "On Open" event of the main form . And here the subform was opened successfully as a separate form (not included in the main form) and the subform fields were populated. Any advice on where to put the VBA code to load the data in the subform? Thanks, JohnG -- Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/Forums.aspx/access-forms/201003/1 |