Prev: Custom Record Selector Controls that don't work like the built-in ones
Next: Custom Record Selector Controls that don't work like the built-in
From: Marshall Barton on 24 May 2010 10:42 If there are no existing records for a subform, then the only thing a user can do is add a new record. If you set the subform's AllowAdditions property to Yes, then a empty record will be displayed ready for data to be entered. If you can not permit new records to be added, then the form will be blank as you are seeing. About the only thing you can do is make a main form label or something visible to display the fact that there is nothing to display: Me.label.Visible=(Me.subform.Form.Recordset.RecordCount=0) If you want, you can hide the blank subform at the same time: Me.subform.Visible=(Me.subform.Form.Recordset.RecordCount>0) Where you would put that code in the main form depends on what triggers the subform to load a different set of records (maybe the main form's Current event?) -- Marsh MVP [MS Access] Finance guy wrote: >This happens when all transactions are deleted from the database, so your >assumption is most likely correct. Is it possible to force the subform to >show all controls regardless of is there is data that meets the criteria to >be displayed? > > >"Daryl S" wrote: >> It sounds like no data meet the criteria to be displayed. This could be due >> to the parent/child link from the main form to the subform. Is the main form >> on a record that has matching subform data? >> >> >> "Finance guy" wrote: >> > I have an Office 2003 database with subforms. The subform displays, but >> > the objects do not show. It displays as one giant rectangle, but all text >> > boxes, etc are completely hidden. >> > >> > Moreover, if I open the subform up, the result is the same. However, if I >> > go to design view, all objects appear. >> > >> > I am unable to get the objects to display on my form.
From: Daryl S on 24 May 2010 14:43
Like Marshall said, if you open the subform to allow additions, then a blank new record will allow the fields to be seen. -- Daryl S "Finance guy" wrote: > > This happens when all transactions are deleted from the database, so your > assumption is most likely correct. Is it possible to force the subform to > show all controls regardless of is there is data that meets the criteria to > be displayed? > > > > "Daryl S" wrote: > > > It sounds like no data meet the criteria to be displayed. This could be due > > to the parent/child link from the main form to the subform. Is the main form > > on a record that has matching subform data? > > > > -- > > Daryl S > > > > > > "Finance guy" wrote: > > > > > > > > I have an Office 2003 database with subforms. The subform displays, but > > > the objects do not show. It displays as one giant rectangle, but all text > > > boxes, etc are completely hidden. > > > > > > Moreover, if I open the subform up, the result is the same. However, if I > > > go to design view, all objects appear. > > > > > > I am unable to get the objects to display on my form. > > > > > > Any assistance appreciated. |