Form and subform

I have a form (master form) and sub form

What I want

I want to  put a button in a master form to change the view of the subform

from data sheet view to single form view


0
a
2/12/2008 11:36:28 AM
access.formscoding 7493 articles. 0 followers. Follow

4 Replies
513 Views

Similar Articles

[PageSpeed] 11

I've been trying this. and I can't do it either. I even found the righyt 
property
Forms!myform.mysubform.Form.CurrentView 
but you can't set it at runtime.

You'd have to: turn echo off, close the mainform, open the subform in Design 
view, change what views are allowed, then reopen the mainform, find your 
record, and turn echo back on.

or

you could use a tab control and put a single record subform on one tab, and 
a datasheet subform on tab 2.

Hmm?


"a" wrote:

> I have a form (master form) and sub form
> 
> What I want
> 
> I want to  put a button in a master form to change the view of the subform
> 
> from data sheet view to single form view
> 
> 
> 
0
Utf
2/12/2008 4:05:01 PM
Using two subforms is a good idea.  And a tab control can
make the option obvious to users.

Using a option or command button to make one subform
invisible and the other visible is essentially the same
thing, but it provides a little more UI design flexibility.

OTOH, changing anything via design view is a really bad idea
for a host of serious reasons.
-- 
Marsh
MVP [MS Access]


roger wrote:
>I've been trying this. and I can't do it either. I even found the righyt 
>property
>Forms!myform.mysubform.Form.CurrentView 
>but you can't set it at runtime.
>
>You'd have to: turn echo off, close the mainform, open the subform in Design 
>view, change what views are allowed, then reopen the mainform, find your 
>record, and turn echo back on.
>
>or
>
>you could use a tab control and put a single record subform on one tab, and 
>a datasheet subform on tab 2.

>
>"a" wrote:
>> I have a form (master form) and sub form
>> 
>> I want to  put a button in a master form to change the view of the subform
>> from data sheet view to single form view
0
Marshall
2/12/2008 4:54:09 PM
OTOH, changing anything via design view is a really bad idea
for a host of serious reasons.

really? like what? (I'm actually asking, not being a dick)



"Marshall Barton" wrote:

> Using two subforms is a good idea.  And a tab control can
> make the option obvious to users.
> 
> Using a option or command button to make one subform
> invisible and the other visible is essentially the same
> thing, but it provides a little more UI design flexibility.
> 
> OTOH, changing anything via design view is a really bad idea
> for a host of serious reasons.
> -- 
> Marsh
> MVP [MS Access]
> 
> 
> roger wrote:
> >I've been trying this. and I can't do it either. I even found the righyt 
> >property
> >Forms!myform.mysubform.Form.CurrentView 
> >but you can't set it at runtime.
> >
> >You'd have to: turn echo off, close the mainform, open the subform in Design 
> >view, change what views are allowed, then reopen the mainform, find your 
> >record, and turn echo back on.
> >
> >or
> >
> >you could use a tab control and put a single record subform on one tab, and 
> >a datasheet subform on tab 2.
> 
> >
> >"a" wrote:
> >> I have a form (master form) and sub form
> >> 
> >> I want to  put a button in a master form to change the view of the subform
> >> from data sheet view to single form view
> 
0
Utf
2/12/2008 5:19:01 PM
roger wrote:
>"Marshall Barton" wrote:
>>OTOH, changing anything via design view is a really bad idea
>>for a host of serious reasons.
>
>really? like what? (I'm actually asking, not being a dick)


Design change are the least efficient way to control
form/report behavior and the performance penalty can be
irritating.

There is a much greater chance of corruption when a heavy
duty object (i.e. table, form, report or module) is
modified.  When that is done at run time, there are none of
the safety checks that a developer imposes when making
design time changes (e.g. frequent backups, ability to
notice strange behavior, ability to quickly recover without
data loss, etc).

Those heavy duty objects also take a lot of space so design
changes will bloat the file.  Frequent design changes can
bloat the file very quicky.

Dealing with bloat means frequent compacting, which in turn
is an extremely heavy duty operation that can modify every
byte in the file and, if anything goes wrong, destroy the
file.

Because of all the potential problems, you need to create
and enforce robust, frequent backup procedures and the
ability to reliably restore or reinstall the file quickly.

Even if all that is ignored, the mdb file can not be
converted to an mde file because design changes can not be
made to an mde.

Then there are all the security issues accociated with the
design-change code behaving like a virus.

-- 
Marsh
MVP [MS Access]
0
Marshall
2/12/2008 7:14:38 PM
Reply:

Similar Artilces:

Opening a template form & renaming it from a cell input automatica
I want to use Excel for a Form in our office, but i need to make sure that it is saved using the last name of the client found in a cell. How can i make this "idiot proof"? -- J Galt ...

Passing form name
I found this code (EnableFormControls) in the forum to enable/disable controls on a form but I'm having trouble setting the variable 'frmAny' and passing it to the sub EnableFormControls. What am I doing wrong? Sub EnableFormControls(frmAny As Form, _ strControlSkip As String, _ Optional tfEnable As Boolean = True) Dim ctlAny As Control On Error GoTo ERROR_Handler frmAny(strControlSkip).SetFocus For Each ctlAny In frmAny.Controls If ctlAny.Name <> strControlSkip Then Select Case ct...

Search and verify that all forms are password protected
Is there a quick way that I can search through all of my forms and ensure that protection is enabled on them? I've done a project of about 300 forms. They will all be uploaded to a Sharepoint drive. Is there a quick way that I can ensure that all of the files have protection enabled before I upload them (without having to open every file and check)? See the article "Skipping Password Protected Documents in a Batch Process" at: http://www.word.mvps.org/FAQs/MacrosVBA/CheckIfPWProtectB4Open.htm -- Hope this helps. Please reply to the newsgroup unless you wish...

e-mail the current worksheet using a form button
I want to create a submit button that when I click on it, the current worksheet/file will be e-mailed to someone. Instead of saving the file, then inserting into an e-mail. I have seen this before in a file before, but can't figure out exactly how it works. I happened to notice in the VB Editor I saw something like... CommandClick() Excel.Application.Send "myname@email.com" End Sub Or something similar to that. I don't know any VBA.. So if that's what I need to learn, then let me know. TIA Richard, check out Ron's site for a LOT of information on this http://...

Form Control Button Name
I have 2 Form Control Buttons that I have assigned macros to in Worksheet 1. In one of the Buttons, my macro (among other things) copys Sheet 1 from Worksheet 1, and pastes it into a New Worksheet and attempts to delete the Control Buttons. The problem is, in Worksheet 1, my Control Buttons are named "Button 4" and "Button 48". When Sheet 1 from Worksheet 1 gets copied to the New Worksheet, the Control Buttons names change ("Button 2" and "Button 3" in one test and "Button 4" and "Button 5" in another test on a different ...

Newbie question about various forms options
Hi, Very new to sharepoint. I've been tasked with trying to use one list for PTO requests. While the PTO request is being made in a new record in the list we'd like certain fields to be enterable and visible. If the user wants to go to the same record after approval and cancel the PTO request, we'd like another set of fields to be available to the user. What I've found is that I am inundated with various options fo this. Liveform (a 3rd party tool), swapping list views (seemingly the easiest since it's a native sharepoint solution), creating custom aspx...

Bill of Lading form
I am looking for a Bill of Lading form for Dynamics for shipments my company makes. Has anyone found a form that works with the system? I know that the German version of the program has one, beets me why the US version doesn't. A reasonably good BOL form can be created using Crystal or SRS. You will need to use some of the optional fields in Inventory to flag any items that may require special handling, if your firm has any such hazardous materials. -- Richard L. Whaley Author / Consultant / MVP Documentation for Software Users Get our Free Tips and Tricks Newsletter and che...

Problem with iif and datediff expression in form
Hi, I have a form where I have to display the value of the field based on some criteria. The first criteria is =IIf((DateDiff("d",[dbo_PWO_Status].[WorkOrderDate],Now())-180)>0,"Y","") and the second criteria to add is dbo_PWO_Status.[Quote] = -1 My first question is how do I accommodate the dbo_PWO_Status.[Quote] = -1 criteria in the iif statement? The second question I have is that with the first expression put in the source for display I am getting Name instead of the Y value for matching condition. I would appreciate any help. Thanks. You n...

Form goes blank when no records 12-15-09
Messaggio multiparte in formato MIME. ------=_NextPart_000_009F_01CA7D8E.88CB66E0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable I have a form that goes blank when a user deletes all records. Is there a way to have vba to add a record when the form is open. This=20 would keep the form from going blank. ------=_NextPart_000_009F_01CA7D8E.88CB66E0 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">...

Set a value on a form
I use the following code to open a form DoCmd.OpenForm stDocName, , , stLinkCriteria Is there any way to pass data to the form (through the constructor) or to set the value of a label on the form Thank you, Samuel You can use the OpenArgs argument to pass a value to the new form, and then use the new form's Load event to read the value and put it into a control on itself. First step -- pass the value: DoCmd.OpenForm stDocName, , , stLinkCriteria, , "ValueToPass" Second step - read the value and use it; this code goes with the Load event of the stDocName form: ...

How to find the check form to use for GP 9.0
I don't want to use Deluxe as our check vendor. I want to use Harland. Microsoft MBS sales just gives us Deluxe's phone number, when we request help with obtaining the correct format for Harland checks. Harland has two check formats for GP payable checks. 1) Great Plains Accounting 7.0 - 9.0 2) Great Plains Dynamics Harland isn't sure and can't reference Deluxe. Thanks, John John, From what I can tell from Harland's website, you want the Laser Multi-Purpose checks they show under Microsoft Great Plains. That's the one with the check in the middle, stub on t...

Get Subform Data
I'm looking for a way to get the data from a chosen record in a continuous subform. I have a customer form and a continuous subform with all of the charges associated with the customer. Is it possible to have a button on the form, prompt the user to highlight a record (the charge info.) in the continuous subform and get the information about the charge? If there is not a way to do this, I'm pretty sure that I can achieve what I want to do via a list box. Open the subform in design view, and set its Record Selectors property to Yes. (This is a property of the Form, not o...

Continuous Form 11-17-07
I have a Dashboard with a subform that is a continuous form. The subform is a summary list of all audits in the database. I want the user to be able to click on the audit number listed in the subform and have another form "frmAA" open filtered to that particular audit and ready for editing. I've seen attempted solutions posted but results have been either the frmAA opening to a blank record or opened to a particular audit regardless of the audit that was selected. Thanks in advance, kljohn should be easy enough. the audit table has a primary key field, correct? and tha...

newbie question: read form properties from another class
Hi, I am sorry for this n00b question, but I'm stumped. I created a form application (using C#.NET Express). For now, it is a simple, singe form, that contains 1 button and 1 textbox. The button calls a method in another class. My question: how do I read the forms' textbox text from that class? My problem seems to be getting a proper reference to the form in my class. My background is VB6, where this was straightforward. I tried the following: -make the textbox public, -create a public property in the form, that returns the textbox text, -passing the form ob...

Use values from a form as criteria in a DSum
Hello All, I have a report in which the end user selects a single person or multiple people from a form and then I store their selection(s) in a temp table (ttmp_Prn_Isu). I have a report that uses this temp table as its datasource so that I can sort and group it properly. All the fields are populated via DSum function because the final report resembles a crosstab report that may contain rows with no data and yet the rows still need to be seen. My difficulty is in referencing the personID stored in the temp table ([ttmp_Prn_Isu].[IsuNm]) as criteria in my DSum function. I also have...

Creating a Form #2
Hi: I am trying to create a database of people that attended my mortgage seminar. But instead of giving them a 4x6 piece of paper to write their information on, I will have my laptop at the booth and have them fill out the information that is created in an excel form. It's just to hard to read people's handwriting these days. I am trying to create a form that once someone's fills it out their information will automatically go to another part of the worksheet. But what I don't know how to do is get rid of the previous person's information before the next person fills ...

Scroll Bar on Forms
I am using tab controls to move through my forms. When the form opens, the right scroll bar is not at the top, but a little ways down. This prevents the tabs from being seen, without moving the scroll bar to the top. I am using a Form Header and a detail section. How can I make sure the scroll bar on the right, stays at the top upon opening the form. Thanks In your form's Load event, SetFocus to a control that can receive the focus and will result in your form being scrolled to the proper location, -- HTH Stephen Lebans http://www.lebans.com Access Code, Tips and Tricks Please re...

recall of infor on a form
I have created two tables: table one has basic info lname, fname, grade, student id number. Table two is an incident report form with fields: student id number, date ,grade , etc. I have a relationship from table one to to table two in a one to many relationship respectively. My user wishes to enter incidents on a form. So I created a form from table two and all works as planned. However my user would like to enter either a)student number or b) last name with out using a drop down list( long list of choices.) and then have it display both student number and last name then save...

Duplicate the record in form and subform
Hi Allen Browne, I try to use your code to duplicate the record in form and subform but I got a error message "Error#3265". BTW, my primary key value is not autonumber, how to change the code to fit my database? Thanks for your expert comments in advance! Presumably we are talking about this article: http://allenbrowne.com/ser-57.html The "Item not found" error was caused by which line? Whichever line it is, you have some name Access can't identify, e.g. you have not changed the field names to match what's in your form. -- Allen Browne - Microsoft MVP...

Outlook 2003 Forms Problem
Whenever I try to open or design a form, Outlook keeps asking me to open another data file. It appears as if it thinks the default library is in another (older) data file. I have tried clearing the forms cache, renaming frmcache.dat, etc. Nothing works. Can anyone help? Thanks. What is the exact text of the error message?=20 --=20 Sue Mosher, Outlook MVP Author of Configuring Microsoft Outlook 2003 http://www.turtleflock.com/olconfig/index.htm and Microsoft Outlook Programming - Jumpstart for=20 Administrators, Power Users, and Developers http://www.outlookcode.com/jump...

How to pass Window name & Form Name Ananymously in procedure?
I want to create generalized procedure for navigation, save, delete, add etc. buttons. But I cannot pass name of the window,name of form anonymously to the procedure. Can I pass name of the window or form in a procedure anonymously as it can be done with tables and fields? I seem to recall that I spent some time on this in Dexterity, and couldn't get it to work. I wish you could. If you find out how, please post or mail me the solution. "Nupur" wrote: > I want to create generalized procedure for navigation, save, delete, add etc. > buttons. But I cannot pass ...

Forms #10
I run Exchange 2003 and MS Outlook 2003. I am wondering about forms under my scenario. Does someone know of a good site that details the use of forms? Thanks Custom Outlook forms? See the Forms pages at www.outlookcode.com -- Ken Slovak [MVP - Outlook] http://www.slovaktech.com Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003 Reminder Manager, Extended Reminders, Attachment Options http://www.slovaktech.com/products.htm "Mostro" <ksdks@aioscoiasn.com> wrote in message news:gJ5Cf.19265$Yu.3003@newssvr27.news.prodigy.net... >I run Exchange 2...

Design the Contact Form
Hi, I want to add a few fields to the standard Contacts form. When I select Design this Form it flickers and I end up looking at a basic version of some kind. I am using Office 2010 so I'm not sure why this happens. Pointers most welcome. Also I too end up with the sticky note icon and not a contacts icon for new contacts using this form. P.S. I can now add that I think it might be the differences between Forms 2.0 controls and Outlook controls. I have added all the Outlook controls to my Control Toolbox but still no joy... ...

displaying Query results to subform
First--the disclaimer--I am in no way a programmer, but I am working diligently to support my team in any way possible. With that said, I have painstakingly created a simple build SQL string code in Access Visual Basic Editor: Private Sub Command8_Click() Dim SQL As String SQL = "SELECT * " & _ "FROM [BCSG_CARDFILE] " & _ "WHERE ((([BCSG_CARDFILE].[IMPORT_FILENAME]) Between " & _ """" & _ Forms![BCSG_CARDFILE_SEARCH]!cboDateFrom.Value & _ """" & _ " And &quo...

Query to Filter by Dates, Using Form
I’m kind of stuck on a query! This works fine, when I just filter for Customers and Traders. Then, I went ahead and added in a couple of ComboBoxes, to allow me to choose a From-Date and a To-Date…now my dynamic query doesn’t work anymore… This SQL Works fine for Cust and Trader, but not for dates: SELECT * FROM Trades WHERE Trades.[Cust] IN('') AND Trades.[Trader] IN(''); Below is my SQL for filtering by dates, but it DOES NOT WORK: SELECT * FROM Trades WHERE ((Trades.Tdate) Between [forms]![SearchForm]![cboFrom] And [forms]![SearchForm]![cboTo]) AND Trad...