Subform not loading

I have a form when it loads, one of the subforms displays as a white blank box. However if I then go to design view then back to Form view the subform loads perfectly. Can anyone help.

Thank You. DR ,

http://transparent-aluminium.net/resources/AccessHelp.jpg

Upvotes: 0

Views: 1165

Answers (3)

TileHittinMofo
TileHittinMofo

Reputation: 29

I stumbled upon this post because I was having the same problem. After MANY hours, I figured out what my problem was.

I was opening the form from a button on the switchboard using the wrong format. I used

DoCmd.OpenForm "frmTaskPackages", acNormal, , , acFormAdd, acDialog

instead of

DoCmd.OpenForm "frmTaskPackages", acNormal, , , acFormEdit, acDialog

Which is why it works after you put the form in design mode for a second; it is no longer opening the form using that code. I hope this helps and this is my first post with code so sorry if my formatting is bad.

Upvotes: 0

After being unable to solve it (and unable to focus on the screen) at 0230 last night I have come up with a solution. As the from loads I blank the SourceObject and then reassign it to the form and requery the form.

Private Sub Form_Load()
Me.STMonth = Me.Month_Picker

Me.SSTATMENTqryCustomerStmtALL_CrosstabXX_subform.SourceObject = ""
Me.SSTATMENTqryCustomerStmtALL_CrosstabXX_subform.SourceObject = "SSTATMENTqryCustomerStmtALL_CrosstabXX_subform"

DoCmd.Requery

Call Command6_Click
End Sub

Its not particulate efficient but it works.

Upvotes: 0

DoNald
DoNald

Reputation: 11

The detail section of a form goes completely blank if both these conditions are met: (a) There are no records to display, and (b) No new records can be added.

Condition (a) might be because of the way the recordset if filtered. Condition (b) might be because the form's AllowAdditions property is set to No, or because the form is based on a read-only query.

Upvotes: 1

Related Questions