By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,984 Members | 2,686 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,984 IT Pros & Developers. It's quick & easy.

Switching veiws on a subform...

P: n/a
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
Share this Question
Share on Google+
1 Reply


P: n/a
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.