Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Changing Form View with a command button 1

Status
Not open for further replies.

WallT

Vendor
Aug 13, 2002
247
US
I know this has to be very simple, however, I can't figure it out. I need a command button that changes my form view from single form to continuous form. I know how to change a subform view to datasheet, but I can't figure this one out. Help please.
 
How are ya WallT . . .

The problem is that the forms [blue]Default View[/blue] property can only be set in [purple]design view![/purple]

Are you sure you want to continue with this? . . .

Calvin.gif
See Ya! . . . . . .

Be sure to see FAQ219-2884:
 
Guess not...I will just make another form to switch to. Thank you
 
WallT . . .

Hold on! I didn't say it couldn't be done!
[ol][li]Is it your intent to [blue]change the view of a subform or mainform?[/blue][/li]
[li]The code I intend depends on the data type of the primarykey. Is it text or numeric?[/li]
[li]Do you want a button that toggles the view . . . what?[/li][/ol]

Calvin.gif
See Ya! . . . . . .

Be sure to see FAQ219-2884:
 

Forget the making another form, stick with the chage between form and datasheetview.

design the form for a single form view and have a button to change the view to datasheet. use the doubleclick event on one of the fields to change it back to form view

I use

Public Sub ShowFormView()
DoCmd.DoMenuItem acFormBar, 2, 1, , acMenuVer20
End Sub

Public Sub ShowDataSheetView()
DoCmd.DoMenuItem acFormBar, 2, 2, , acMenuVer20
End Sub

and there will be another VBA command to do this too.
If you want a prettier datasheetview change it in the tools/options menu.



Ian Mayor (UK)
Program Error
Always make your words sweet and nice. Because you never know when you may have to eat them.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top