469,625 Members | 1,917 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,625 developers. It's quick & easy.

Switching veiws on a subform...

I have a a parent form with a subform. The parent form has two command
buttons to change the subform view to single form view and datasheet view
respectively. I can't seem to get this to work. There is a menu item to
switch to datasheet view, but it won't go back to form view. The only way I
see so far is to open the subform by itself in design view, change the
default view, save & close, then set the sourceobject property in the main
form. Needless to say this is ugly and takes a lot of time. Is there an
easier way?

Thanks.

Matthew Wells
MW****@FirstByte.net
Nov 13 '05 #1
1 1736
Hi,

Played around with your form/subform requirements, couldn't get it to work
by switching the views - got error messages re only being able to set this
criteria while in design mode. So tried this as a workaround, perhaps it
will meet your needs.

I designed a main form and two subforms. Each subform is based on the same
data but one has a default view of datasheet and the other a default view of
single form. One subform has the default of visible = true and the other
visible = false. While in design mode move one subform to lie over the
other then...

Private Sub cmdDatasheet_Click()
Me.mySubFormDatasheet.Visible = True
Me.mySubFormSingleForm.Visible = False
End Sub

Private Sub cmdSingleForm_Click()
Me.mySubFormSingleForm.Visible = True
Me.mySubFormDatasheet.Visible = False
End Sub

HTH -Linda

"Matthew Wells" <MW****@FirstByte.net> wrote in message
news:Q3****************@newsread2.news.atl.earthli nk.net...
I have a a parent form with a subform. The parent form has two command
buttons to change the subform view to single form view and datasheet view
respectively. I can't seem to get this to work. There is a menu item to
switch to datasheet view, but it won't go back to form view. The only way I see so far is to open the subform by itself in design view, change the
default view, save & close, then set the sourceobject property in the main
form. Needless to say this is ugly and takes a lot of time. Is there an
easier way?

Thanks.

Matthew Wells
MW****@FirstByte.net

Nov 13 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Jerry Boone | last post: by
1 post views Thread by John Michael | last post: by
6 posts views Thread by DMUM via AccessMonster.com | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.