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 defaultview Continous Form to Single Form in Visual Basic 1

Status
Not open for further replies.

pkahlo

Programmer
Nov 3, 2003
29
US
This doesn't seem like a terribly difficult question to answer if somebody knows the answer, so I'll try to explain better and hopefully I'll get a response this time :)

I'd like to change the view, like "datasheet", "continous form", "single form" from VB. The only way I see how would be to change the .defaultview property of the subform, but access will give me an error telling me I cannot change that from VB. Is this impossible to do? If not, how do I do this?

Thanks!
 
VB doesn't have a continuous form mode, nor a datasheet mode, as those are Access-only features. VB does have controls that emulate the datasheet mode. For (better) results, try the Visual Basic Databases forum, which has a lot of knowledgeable VB experts who can definitely help you better. forum709
 
Hi!

Should this be a access form thingie (VBA), the error message I get, says it's only available in design view. So, if it's appliccable to your situation, open the form in design view and alter the settings, for instance something like this (not dealing with the form/sub form issue - not sure though, how it would work if you're trying to toggle this from the main form in which the sub resides):

[tt]docmd.openform "myform", acdesign
forms!MyForm.DefaultViev = YourNewValue
docmd.openform "myform", acnormal[/tt]

Defaultview/YourNewValue being between 0 and 2.

HTH Roy-Vidar
 
Not sure if this is what you were looking for but
docmd.runcommand acCmdDatasheetView
will change from form view to datasheet view
docmd.runcommand acCmdFormView
will change back to form view
 
You need to open your form in design view which you can do in code. Then you can change the form's format, also in code, and save the form. I've never tried this when dealing with forms that have subforms which could pose problems. You'll just have to experiment and see what works.

AvGuy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top