How do I use the option button to select one of two subreports?

I'm trying to select one of two subreports I have in an order form, i've 
tried using this code:

Private Sub Design_Frame_AfterUpdate()

    Const conCatalogue_Button = 1
    Const conCustomized_Button = 2
    
        If Me!Design_Frame.Value = conCatalogue_Button Then
        
                Order_Details1_subform.Enabled = True
                Order_Details1_subform.Visible = True
                Order_Details2_subform.Enabled = False
                Order_Details2_subform.Visible = False
            
                Else
                
                Order_Details1_subform.Enabled = False
                Order_Details1_subform.Visible = False
                Order_Details2_subform.Enabled = False
                Order_Details2_subform.Visible = False
                End If
                
        If Me!Design_Frame.Value = conCustomized_Button Then
        
                Order_Details1_subform.Enabled = False
                Order_Details1_subform.Visible = False
                Order_Details2_subform.Enabled = True
                Order_Details2_subform.Visible = True
            
                Else
                
                Order_Details1_subform.Enabled = False
                Order_Details1_subform.Visible = False
                Order_Details2_subform.Enabled = False
                Order_Details2_subform.Visible = False
                End If
                


End Sub


Thats to display and enable me use the first subreport and not the second, 
if I select the first option and to display and enable the second report and 
not the first, if I select the second. 

It works with the second option, but the first option can't display the 
subreport if it's selected. It displays a blank page, any help? I'm using 
[Access 2000 file format], thats Office 2003.

Thank you.

0
Utf
4/26/2007 4:30:05 PM
access.formscoding 7493 articles. 0 followers. Follow

2 Replies
534 Views

Similar Articles

[PageSpeed] 5

You are mixing terminology...

Forms have subforms, not subreports.

Another approach would be to use a single subform on your main form, and use 
the option group selection to set the source of that subform to one or the 
other (sub)-form.

Regards

Jeff Boyce
Microsoft Office/Access MVP

"stripes" <stripes@discussions.microsoft.com> wrote in message 
news:25F2DFC8-4635-4235-BFB3-3B2BD8908B65@microsoft.com...
> I'm trying to select one of two subreports I have in an order form, i've
> tried using this code:
>
> Private Sub Design_Frame_AfterUpdate()
>
>    Const conCatalogue_Button = 1
>    Const conCustomized_Button = 2
>
>        If Me!Design_Frame.Value = conCatalogue_Button Then
>
>                Order_Details1_subform.Enabled = True
>                Order_Details1_subform.Visible = True
>                Order_Details2_subform.Enabled = False
>                Order_Details2_subform.Visible = False
>
>                Else
>
>                Order_Details1_subform.Enabled = False
>                Order_Details1_subform.Visible = False
>                Order_Details2_subform.Enabled = False
>                Order_Details2_subform.Visible = False
>                End If
>
>        If Me!Design_Frame.Value = conCustomized_Button Then
>
>                Order_Details1_subform.Enabled = False
>                Order_Details1_subform.Visible = False
>                Order_Details2_subform.Enabled = True
>                Order_Details2_subform.Visible = True
>
>                Else
>
>                Order_Details1_subform.Enabled = False
>                Order_Details1_subform.Visible = False
>                Order_Details2_subform.Enabled = False
>                Order_Details2_subform.Visible = False
>                End If
>
>
>
> End Sub
>
>
> Thats to display and enable me use the first subreport and not the second,
> if I select the first option and to display and enable the second report 
> and
> not the first, if I select the second.
>
> It works with the second option, but the first option can't display the
> subreport if it's selected. It displays a blank page, any help? I'm using
> [Access 2000 file format], thats Office 2003.
>
> Thank you.
> 


0
Jeff
4/26/2007 5:26:19 PM
Thanks, actually I realised I had mixed up the term though at least what I 
meant was understood.

Well actually, I was able to solve that problem using the tab control as a 
template for the subforms and this was the code:

Private Sub Design_Frame_AfterUpdate()

    Const conCatalogue_Button = 1
    Const conCustomized_Button = 2
    
        If Me!Design_Frame.Value = conCatalogue_Button Then
             Page125.Visible = True
             Page126.Visible = False
             
                        
                Else
             Page125.Visible = False
             Page126.Visible = False

   
                
               End If
                
        If Me!Design_Frame.Value = conCustomized_Button Then
             Page126.Visible = True
             Page125.Visible = False
            
                        
                Else
             Page125.Visible = False
             Page126.Visible = False
                
                End If         


End Sub
----------------------------------------------------------------------------------------------

Well its working the way I want it to with the code above but I can't seem 
to get the total value from the second sub form displaying on the main form 
like it does with the first.

The idea is, the overall total of either should display upon selection of 
one of them.
That is the overall total of the first subform should display if thats 
selected or viceversa.


Thats were I stand now.

All the same thanks for the reply.

"Jeff Boyce" wrote:

> You are mixing terminology...
> 
> Forms have subforms, not subreports.
> 
> Another approach would be to use a single subform on your main form, and use 
> the option group selection to set the source of that subform to one or the 
> other (sub)-form.
> 
> Regards
> 
> Jeff Boyce
> Microsoft Office/Access MVP
> 
> "stripes" <stripes@discussions.microsoft.com> wrote in message 
> news:25F2DFC8-4635-4235-BFB3-3B2BD8908B65@microsoft.com...
> > I'm trying to select one of two subreports I have in an order form, i've
> > tried using this code:
> >
> > Private Sub Design_Frame_AfterUpdate()
> >
> >    Const conCatalogue_Button = 1
> >    Const conCustomized_Button = 2
> >
> >        If Me!Design_Frame.Value = conCatalogue_Button Then
> >
> >                Order_Details1_subform.Enabled = True
> >                Order_Details1_subform.Visible = True
> >                Order_Details2_subform.Enabled = False
> >                Order_Details2_subform.Visible = False
> >
> >                Else
> >
> >                Order_Details1_subform.Enabled = False
> >                Order_Details1_subform.Visible = False
> >                Order_Details2_subform.Enabled = False
> >                Order_Details2_subform.Visible = False
> >                End If
> >
> >        If Me!Design_Frame.Value = conCustomized_Button Then
> >
> >                Order_Details1_subform.Enabled = False
> >                Order_Details1_subform.Visible = False
> >                Order_Details2_subform.Enabled = True
> >                Order_Details2_subform.Visible = True
> >
> >                Else
> >
> >                Order_Details1_subform.Enabled = False
> >                Order_Details1_subform.Visible = False
> >                Order_Details2_subform.Enabled = False
> >                Order_Details2_subform.Visible = False
> >                End If
> >
> >
> >
> > End Sub
> >
> >
> > Thats to display and enable me use the first subreport and not the second,
> > if I select the first option and to display and enable the second report 
> > and
> > not the first, if I select the second.
> >
> > It works with the second option, but the first option can't display the
> > subreport if it's selected. It displays a blank page, any help? I'm using
> > [Access 2000 file format], thats Office 2003.
> >
> > Thank you.
> > 
> 
> 
> 
0
Utf
4/30/2007 5:50:03 PM
Reply:

Similar Artilces:

Password protect send button
Work in an environment similar to the CarreerBuilder commercial with the monkeys. Everyone thinks it's sooooooooooooooooooo funny to send Outlook emails from my computer when I'm not at my computer. Is there a way to in VBA to require a password before emails are sent ? Why can't you lock your PC when you're away from it? That's what I would advise. Leaving it unlocked invites just such activity as you've described and rightly so. You are ultimately responsible for all emails sent and received at work, if you leave Outlook unsecured how is it you would prove tha...

Attachment Selection
When composing a new mail message there are buttons to use to select the following: To: Cc: and Bcc: as well as a box to type in the Subject. We used to have an additional button to select a file to ATTACH to the message as well. And the attached files would appear in the message header. That option has disappeared, and we can now only INSERT using the Insert on the Menu or the Paperclip; with the inserted files appearing within the body of our message. We would like to be able to have the Attachment Selection button and box back. Why is it no longer available, and how can be get ...

Using Word 2003 as email editor in Outlook 2003
Hi When I try to use Word 2003 as my email editor I get instead: " Microsoft Word is set to be your email editor. However, Word is unavailable, not installed, or is not the same version as Outlook. The Outlook email editor will be used instead." This used to work prior to my changing file servers at work a couple of weeks ago. I have tried a LOT of suggestions, including those in the Show Help button of the error dialog and here: http://support.microsoft.com/kb/906307/en-us and here: http://www.microsoft.com/office/community/en-us/wizard.mspx?query=word+as+outlook...

Adding custom pages to Windows Control Panel using MFC
Hi, Is there anybody know how to add a custom page to Windows Control Panel using MFC? I found some code on Internet but that was written in Win32 API. Also tried to find the material on MSDN but the content is pretty old (if I am correct) : http://msdn.microsoft.com/archive/default.asp?url=/archive/en-us/dnarvc/html/msdn_ntcplapp.asp Thanks. Is this what you're looking for? http://www.codeproject.com/shell/cpl.asp Tom <hugheslin@hotmail.com> wrote in message news:1145355183.002746.18420@z34g2000cwc.googlegroups.com... > Hi, > > Is there anybody know how to add a cus...

Merging two fields into one?
Il give you an example of what I want to do - will explain it much easier. I want to merge two fields from the same table which is about some people. How do I merge one field from the table (such as their firstname) with another (such as surname) to make it look like one field in a database form? SilverSword, You can use concatenation to combine two (or more) text values. This is not done in your table, but on a form, or in a query, or on a report. On a form, based on your names table, or a query against that table, place a text control with a ControlSource of... ...

one code to do multiple things
hi, i have the code below which takes the value in cell U17 everytime it changes, and places it in column A on a sheet called graphs thereby forming a list down the sheet of all the values that appear in cell U17, for charting purposes. What i would like to do is to be able to duplicate this for different cells. ie have the cell values of W25 appear in a list in column K on the graphs sheet, and so on. this code was written for me by someone else as, could you please give me some code that will enable me to capture the values for two or three cells in sheet1 into the sheet cal...

Chart using Macro
I have several sheets having similar data for different lanes. I have a macro which can create a graph I want with different series plotted in different forms for source data on a particular sheet. I want to be able to create a graph for the active sheet. How do I use ActiveSheet data as source data for the gaph. ...

using DoCmd.OutputTo for reports: event code doesn't execute
I use DoCmd.OpenReport and the Load event code gets executed. But when I use the DoCmd.OutputTo for the same report, the load event code does NOT execute. Is this normal and I missed the documentation that says this or is there a property that I need to set? Thanks for any help. --Michael ...

ODBC Connection through Access VBA using Windows 7
We have a push to begin rolling out machines with Windows 7. In our testing of our Operations Access Databases, we are running into some real weird things going on when we're trying to establish an ODBC connection through Access VBA into Oracle Databases. Has anyone seen this or know anything about it? Is there a "Red Book" on anything regarding ODBC connections using Windows 7??? I appreciate your review and am hopeful for a response. Thanks. PSULionRP On Thu, 27 May 2010 14:08:20 -0700, PSULionRP <PSULionRP@discussions.microsoft.com> wrote: Not t...

retrieve an AVERAGE of a range using VLOOKUP to locate start/end d
Can I calculate the average of a range based on VLOOKUP? In other words, can I get Excel to "look up" the respective START / END dates of an investment position listed in Sheet 1 and then go and locate those 2 distinct cell values in in a different sheet (Sheet 2) utilizing VLOOKUP function and then return the calculated AVERAGE of the cells within that range back into Sheet 1? Appreciate any thoughts if doable in Excel in any way? tAKE A LOOK AT AverageIFS and see if that does what you want. If it were me, I'd probably enter the formula manually, record the resu...

Add more than one series to a pivot chart using VB MS Access continued...
I'm trying to programmatically create a stacked bar pivot chart. Using "Programming Microsoft Office Access 2003" by Rick Dobson, I've created the chart. However, it doesn't distinguish between the different values for the series. Does anyone have any suggestions on how to create a chart using one column containing three values for the series? Essentially, this is a continuation of a previous post: http://groups.google.com/group/microsoft.public.access.formscoding/browse_thread/thread/e23f3506a6d561a0/674295d410a71cf9%23674295d410a71cf9" Any help is greatly appre...

Summing a selection of lines in a pivot table
Hi all, Probably a totally newbie question on pivot tables but I can't seem to find out how it works. Here's my problem: I've got an Excel worksheet that (coming in from jet reports) contains something like #Asset 1 Description A1 Total A1 Mapping A1 = X1 #Asset 2 Description A2 Total A2 Mapping A2 = X1 #Asset 3 Description A3 Total A3 Mapping A3 = X2 #Liability 1 Description L1 Total L1 Mapping L1 = X3 #Liability 2 Description L2 Total L2 Mapping L2 = X4 #Liability 3 Description L3 Total L3 Mapping L3 = X4 This last field, mapping, is what's important for my pivot table; it...

how to use RichInk control for Mobile word
Hi all, I am trying to view the word documents in Pocket PC. I got some MFC code in the following link. http://www.pocketpcdn.com/articles/word_embed.html It is doing well for reading Pocket PC 2003 word document (.psw). I tried this to read Mobile word ( Word document for WM 5.0).It showing some same invalid data for any input. If anybody has idea on it please help me.. Thank you, Supriya. ...

End Program Hanging...after using Money Deluxe
After using MS Money Deluxe, Win XP, All files are current and up to date : When I close Money and want to shut the computer down I get a message pop up, End Program : 5A25A898 THAT HANGS, Then I get another END PROGRAM: MCI Command Handling. Then I invoke Task Manager to end all tasks and the computer shuts down. Any suggestions. Thanks In Advance In microsoft.public.money, Birdflu wrote: >After using MS Money Deluxe, Win XP, All files are current and up to date : > >When I close Money and want to shut the computer down I get a message pop >up, End Program : 5A25A898 THAT...

Relaying using AUTH
Someone had guess a weak password on one of my user accounts, and was using this with the AUTH command to relay messages off my Exchange 5.5 IMC. I enabled protocol logging, and saw the AUTH commands, and tracked down what account they were using with a base64 decoder and disabled the account. Now I want to find out what IP address these were originating from so I can repay the SOB. However, the protocol log only has hostnames where it says "accepting connection from hostname.domain.com". and the host names are bogus. I tested it, and it logs whatever you have entered a...

Pulling Data from one worksheet into another
Hi, I have a question regarding pulling text from one worksheet into another. Please can you help me? I need to duplicate the information (text only) on one worksheet to another one as it is typed. Is there a formula I can use that will allow the data typed in one worksheet to appear in the other one immediatley? I have a formula that the person before was using but I don't know how to apply it to the whole sheet. Any advice would be greatly appreciated. The formula is =IF(ISBLANK(OFFSET(OFFSET('Design Schedule'!$B$8,$A15,$B15),0,H$7)),"",OFFSET(OFFSET(&...

Running a Macro depending on Validation List Selection
Is there a way to run a Macro depending on the result of a validation list selection? I have a list of store names with specific number of techs. I select Shop A and Macro 1 Runs I select Shop B and Macro 2 Runs, etc. What I want to accomplish is depending on the value in a cell, it will run the specific Macro. Any help is appreciated and Thank you in advance for the help. Fester Fester Assuming A1 has the DV drop-down. Private Sub Worksheet_Change(ByVal Target As Excel.Range) On Error GoTo enditall Application.EnableEvents = False If Target.Address = "$A$1" Then Select Cas...

looking for control to display dialog similar to VC NET option window
I would like to implement a dialog similar to the VC++ NET options window. The left side of the options windows contains a tree control used to select general category of options that will be viewed/edited. The right side of the options window displays an dialog that allows the user to view/edit specific options. Are there any shareware/commercials controls available that provide this functionality? Thanks in advance. Ian I think I've seen something like that in www.codeproject.com (and for free) ...

using the time structure with MFC
Hi, Coming from C, how could I translate this into MFC based code (using CString)? char szTime[65], szDate[65]; time_t t = time(0); struct tm* tm = localtime(&t); strftime(szDate, 64, "%Y%m%d", tm); strftime(szTime, 64, "%H%M%S", tm); CString strTime, strDate; Thanks CTime Time = CTime::GetCurrentTime(); CString strDate = Time.Format("%Y%m%d"); CString strTime = Time.Format("%H%M%S"); AliR. "markww" <markww@gmail.com> wrote in message news:1156883820.948360.39250@m79g200...

Excel Automation using in VC 2005
Hi all, I am doing excel automation using MFC in VC 2005. It is just a simple program to just open an excel sheet nothing more than that. I have followed steps describerd in this link: http://support.microsoft.com/kb/308407 But when i build the project it is giving following errors, Can any body tell why it is happening like this..? Errors: error C2371: 'FontPtr' : redefinition; different basic types error C2786: 'BOOL (__stdcall *)(HDC,int,int,int,int)' : invalid operand for __uuidof error C2923: '_com_IIID' : 'Rectangle' is not a valid template type arg...

Screen or print option while printing report
Allow a default for the company or the user that can set the report option ( Screen or Print ) -- Regards Santosh ---------------- This post is a suggestion for Microsoft, and Microsoft responds to the suggestions with the most votes. To vote for this suggestion, click the "I Agree" button in the message pane. If you do not see the button, follow this link to open the suggestion in the Microsoft Web-based Newsreader and then click "I Agree" in the message pane. http://www.microsoft.com/Businesssolutions/Community/NewsGroups/dgbrowser/en-us/default.mspx?mid=8c0c7c3b...

there is a problem with the selected printer
When I try to print emails from Outlook 2007 I get the error message below: "There is a problem with the selected printer. You might need to reinstall this printer. Try again, or use a different printer." I used Outlook 2007 at my office and we are on a follow-me printing network. I don't have issues printing any other documents from Office 2007, it's just the emails that have this problem. Does anyone have a resolution to this issue? ...

toggle button nightmare
I use Access 2003. This problem is relative to a continuous form. I have a subform with toggle buttons. The concept is to click them when their associated attributes are considered "critical". For example, I have a field called [IDLength]. It has an "associated" field called [IDLCritical] which is used to capture the toggle button's value. I want the toggle button to be enabled only IF there's a value in [IDLength] so I devised this AfterUpdate Event: Private Sub IDLength_AfterUpdate() Me.tglIDLCritical.Enabled = IsNull(Me.IDLength = True) Me.t...

How to use C# DLL in MFC
Hi all, I developed one C# DLL. now i want to use that DLL to my MFC application created using vc++. Can any one help me how to load those DLL's.... Thanks in advance, SaranG SaranG(Saravanan) wrote: > Hi all, > I developed one C# DLL. now i want to use that DLL to my MFC > application created using vc++. Can any one help me how to load those > DLL's.... > > > Thanks in advance, > SaranG > > I think you could do that through COM interop. Regards, F. Firstly, this is the wrong newsgroup for this question...anyways... you can ...

How do I get certificates to use to send from email addresses???
Everything seemed to go well in setting up email addresses in outlook. They tested fine and I have no problem receiving messages in outlook. The problem comes when I try to send messages .... and I've tried sending from outlook using each and every email address I've set up. This is the message I get: "Microsoft Outlook could not sign or encrypt this message because you have no certificates which can be used to send from the email address mpenza17@verizon.com." I've tried going to sites and downloading certificates. They don't seem to appear in outlook??? A...