Form view blank when "Allow Additions" = "No"

G

Guest

In a form's properties I change "Allow Additions" to No so that users could
not use this form to add records. Once I do that and then click the view
icon, the form is blank -- nothing but a big grey box. Once I hit the Design
icon, the form is still there, I just can't see it in the View state (what
the user would see).

Why?
 
J

John Vinson

In a form's properties I change "Allow Additions" to No so that users could
not use this form to add records. Once I do that and then click the view
icon, the form is blank -- nothing but a big grey box. Once I hit the Design
icon, the form is still there, I just can't see it in the View state (what
the user would see).

Why?

Presumably because the form is based on a Query which returns no
records, and it's also not updateable. It might be that the Allow
Edits property of the form is set to No, or the Query itself might not
be updateable.

If the Form returns no records, and doesn't allow new records, you'll
just get a white box; there's nothing to show (neither an existing
record nor the new record).

John W. Vinson[MVP]
 
G

Guest

Yep, that was it. So simple! Thank you. I assumed that if there were no
records, I'd get the form, but with all the fields blank. Now, I know that's
not the case. Thanks!
 
J

Jayyde

If you add something like the following you can still keep the
AllowAdditions false unless it comes back empty:

Private Sub Form_Open(Cancel As Integer)

If (Me.Recordset.RecordCount = 0) Then
Me.AllowAdditions = True
End If

End Sub
 

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