Program Continuous Form or Single Form views

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
 
A

Alex Dybenko

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
 
F

fredg

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
 

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