Program Continuous Form or Single Form views

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi guys,

I am hoping to be able to switch a form programmatically between a
DefaultView of Continuous Form and Single Form however, when I attempt
something like
Me.DefaultView = 0
I get a message telling me to set the property in Design view.

Any suggestions?
and thanks
Teewan
 
Sorry, but you can set this property only in design view. you can try to
make 2 forms with 2 views and show different forms instead
 
Hi guys,

I am hoping to be able to switch a form programmatically between a
DefaultView of Continuous Form and Single Form however, when I attempt
something like
Me.DefaultView = 0
I get a message telling me to set the property in Design view.

Any suggestions?
and thanks
Teewan

You need to do the change in design view.
Here's how.

DoCmd.Echo False
DoCmd.OpenForm "frmYourForm", acDesign
If Forms!frmYourForm.DefaultView = 0 Then
Forms!frmYourForm.DefaultView = 1
Else
Forms!frmYourForm.DefaultView = 0
End If
DoCmd.Close acForm, "frmYourForm", acSaveYes
DoCmd.OpenForm "frmYourForm"
DoCmd.Echo True
 
Back
Top