473,763 Members | 9,161 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Control Tab Possibllities

166 New Member
Hello:

I have something I would like to do and I was wondering if tab controls was the best route to accomplish it.

I have 5 categories of material types. I created the application from an excel sheet that had the categories listed. My boss would like my form to be as close as possible to the excel sheet. He would like for each material to be input by material type separately, which is currently not how I have it set up. currently, you select the matType and material in the same form, for all material types. I came up with the idea to use the tabs. I had an unbound text box at the top of the tab to have the user select the matType. My idea was that based on the matType selected, the continuous subform would populate with records related to that matType, in addition allow user to add data for that matType. Initially I thought I could have one form and have the data load based on the matType, however, I never was able to make it happen using one form. I now have a form representing all of my categories and the query that is the form's record source is filtered by the matType that the subform represents. Here is what a query for matType1 looks like:

Expand|Select|Wrap|Line Numbers
  1. SELECT MixSample.DM_Mix, MixSample.DM_MaterialNo, MixSample.matTypeID, MixSample.materialID, MixSample.matBatchWeight, MatType.matType, Material.material, Material.materialGrav, GetYield([MixSample].[matTypeID],[matBatchWeight],[Material].[materialGrav]) AS DMYield, MixSample.pigPercent, DLookUp("matPrice","MatPrices","materialID = " & [MixSample].[materialID] & " AND matPriceActive = True") AS _matPrice, GetMixCost([MixSample].[matTypeID],[matBatchWeight],[_matPrice]) AS DMMixCost FROM Material INNER JOIN (MixSample INNER JOIN MatType ON MixSample.matTypeID=MatType.matTypeID) ON Material.materialID=MixSample.materialID WHERE (((MixSample.DM_Mix)=Forms!F_Test2_MixDesign!DM_Mix) And ((MixSample.matTypeID)=1)); 
Additionally, the materialID combo box allows the user to select the material related to that matType they are using.

I have a few questions:

1) When all 5 categories of materials are input, I need a running total that will use different information entered. Since I have different information on different forms, on diff tabs, is this possible? I ask bc even when I had everything together, it was funky about my subtotals. I had to have a text box on the subform calculate it and then on the main form just copy from the subform text box.

2) I have been trying to make it so that when the user selects a matType (located on the subform), the subform and tab it sits on, go invisible with the exception of the selected tab...I have tried so many things, but nothing works. I use a select case statement to drive the tabs:

Tab Control Name: Tabctl1 (Access does not seem to recognize my tab control name)
Tab 0 Name: pgeOne
Tab 1 Name: pgeTwo
Tab 2 name: pgeThree
" 3 " : pgeFour
" 4 " : pgeFive

I have tried:

Private Sub matTypeID_After Update()
Select Case matTypeID

Case 1

Me.materialID.R equery
Me!TabCtl1.Page s(0).SetFocus

Case 2
Me.materialID.R equery
Me.Tabctl1.Page s.Item("pgeOne" ).SetFocus

etc...(I have not included the whole case statement). Neither format in case 1
or 2 works. I found this information here: http://bytes.com/topic/access/insigh...bs-tab-control

Will I be able to keep a total of the data I need, even though the calculations are stored in the footer of several forms and on the main form?

Please feel free to ask additional questions related to my issue. I appreciate any assistance.
Mar 25 '09 #1
56 5040
ChipR
1,287 Recognized Expert Top Contributor
One thing you can do is set

Tabctl1.Pages(x ).Visible = False

for all but one page. Then it will show that page!
Mar 25 '09 #2
csolomon
166 New Member
Hi Chip,

the 'x' represents the page name or index? I tried both and unfortunately, I can't get it to work.

The only one that should show up is called Cement

Here is where I tried to use the name of the index

Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Current()
  2. TabCtl1.Pages(1).Visible = False
  3. TabCtl1.Pages(2).Visible = False
  4. TabCtl1.Pages(3).Visible = False
  5. TabCtl1.Pages(4).Visible = False
  6. End Sub
  7.  
or this

Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Current()
  2. TabCtl1.Pages(pgeTwo).Visible = False
  3. TabCtl1.Pages(pgeThree).Visible = False
  4. TabCtl1.Pages(pgeFour).Visible = False
  5. TabCtl1.Pages(pgeFive).Visible = False
  6. End Sub
I don't think it's recognizing my TabCtl1 control. How can I test this?

@ChipR
Mar 26 '09 #3
ChipR
1,287 Recognized Expert Top Contributor
Yes, I was referring to the numerical index, starting at zero, like your first code. You should also be able to use .Pages("pageNam e"), but I haven't tested that.

If TabCtl1 is not a valid control, you're going to get an error telling you such, either when you compile, or the Current() event runs. You might want to test with some code in a command button that you can click to run.
Mar 26 '09 #4
csolomon
166 New Member
Chip,

That button suggestion worked. Now I know that it can see my tabCtl1 bc when I pressed the button all of the tabs disappear. Why can't it run in the onCurrent() event?

Also, I am getting an error for a field value. I know I can print out values from my form in the immediate window, but I have not been able to produce the code to do it. For instance on my form I have a field txtWaterBW that I want to find out why it's not working so I typed:
Parent form: F_Test2_MixDesi gn
Subform: SF_CementType
textbox name: txtWaterBW

Here is what I put in the immediate window:
=Form!F_Test2_M ixDesign!SF_Cem entType.txtWate rBW

what am I doing wrong?


@ChipR
Mar 26 '09 #5
ChipR
1,287 Recognized Expert Top Contributor
I guess the question is, Is the onCurrent event being triggered by something? It sounds like it just wasn't being run.

When you refer to a control on a subform, you have to use .Form, like:

...SF_CementTyp es.Form!txtWate rBW
Mar 26 '09 #6
ChipR
1,287 Recognized Expert Top Contributor
I was able to use the tab code in the onCurrent event and trigger it by opening the form or moving to another record, so I'm not sure what the problem is there.
Mar 26 '09 #7
csolomon
166 New Member
Here is what I have in my on current event:

Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Current()
  2. Select Case TabCtl1
  3.  
  4. 'Not sure if I need Case 1, but I put it there bc when I didn't have it , when i triggered the oncurrent event by opening the form, I only saw page 0.  AT any rate, this still only shows page 0.
  5.    Case 1
  6. TabCtl1.Pages(1).Visible = True
  7. TabCtl1.Pages(2).Visible = True
  8. TabCtl1.Pages(3).Visible = True
  9. TabCtl1.Pages(4).Visible = True
  10. TabCtl1.Pages(0).Visible = True
  11.  
  12.    Case 2
  13. TabCtl1.Pages(1).Visible = False
  14. TabCtl1.Pages(2).Visible = False
  15. TabCtl1.Pages(3).Visible = False
  16. TabCtl1.Pages(4).Visible = False
  17.  
  18.    Case 3
  19. TabCtl1.Pages(0).Visible = False
  20. TabCtl1.Pages(2).Visible = False
  21. TabCtl1.Pages(3).Visible = False
  22. TabCtl1.Pages(4).Visible = False
  23.  
  24.    Case 4
  25. TabCtl1.Pages(1).Visible = False
  26. TabCtl1.Pages(0).Visible = False
  27. TabCtl1.Pages(3).Visible = False
  28. TabCtl1.Pages(4).Visible = False
  29.  
  30.    Case 5
  31. TabCtl1.Pages(1).Visible = False
  32. TabCtl1.Pages(2).Visible = False
  33. TabCtl1.Pages(0).Visible = False
  34. TabCtl1.Pages(4).Visible = False
  35.  
  36.    Case 6
  37. TabCtl1.Pages(1).Visible = False
  38. TabCtl1.Pages(2).Visible = False
  39. TabCtl1.Pages(3).Visible = False
  40. TabCtl1.Pages(0).Visible = False
  41.  
  42. End Select
  43. End Sub
  44.  
Let me explain why I am using this. ORiginally I tracked everything in one form, but my job asked me to allow the user to input each category of material in different places so now where I use to have 1 form, I have 5, representing one of the 5 categories of materials...one on each tab. So when the user comes to tab 0, they will only input info related to cement and on and on.

@ChipR
Mar 26 '09 #8
csolomon
166 New Member
I tried:

Expand|Select|Wrap|Line Numbers
  1. =SF_CementType.Form!txtWaterBW
In the immediate window and got this error: Compile error: Expected: line number or label or statement or end of statement.

@ChipR
Mar 26 '09 #9
ChipR
1,287 Recognized Expert Top Contributor
Your code doesn't make sense.

Select Case TabCtl1

This means, "Which tab is being viewed?" I think you want to Select Case based on some other variable, like the category, and show the appropriate tab.

To use the immediate window, do

?(statement to evaluate)

=(statement) is trying to assign the value in (statement) to ??? because nothing is on the left of the =.
Mar 26 '09 #10

Sign in to post your reply or Sign up for a free account.

Similar topics

6
3417
by: Bruce Rusk | last post by:
I'm using Stephen Lebans' RTF2 control in a report, and have discovered what may be a slight bug in it. I have a lot of non-Western language (Chinese) text in my RTF field, and such records get sized strangely using the .RTFHeight property of the control. Specifically, lines of text get cut off the bottom of the control when I use the code provided in the sample report on the lebans.com site. It seems that when there is Chinese text,...
6
11300
by: martin | last post by:
Hi, I am a web page and a web user control. My web user control is placed in my web page using the following directive <%@ Register TagPrefix="uc1" TagName="Header" Src="WebControls/Header.ascx" %> The web user control contains the following server controls
2
3628
by: John Lau | last post by:
Hi, Is there documentation that talks about the page lifecycle, the lifecycle of controls on the page, and the rendering of inline code, in a single document? Thanks, John
20
5650
by: Guadala Harry | last post by:
In an ASCX, I have a Literal control into which I inject a at runtime. litInjectedContent.Text = dataClass.GetHTMLSnippetFromDB(someID); This works great as long as the contains just client-side HTML, CSS, etc. What I want to do is somehow insert a *server control* into the , then set the server control's properties at runtime.
5
3595
by: serge calderara | last post by:
Dear all, I am new in asp.net and prepare myself for exam I still have dificulties to understand the difference between server control and HTML control. Okey things whcih are clear are the fact that for server control component , code is running on the server side. But if I take as example a Label. I place on a webform an HTM label control and a WebForm label control, I could see that properties are different for
2
4924
by: Mike | last post by:
Hi, I am strugling with a simple problem which I can't seem to resolve. I have an asp.net page which contains a server-control (flytreeview, which is a kind of a tree to be exact). The tree is being updated by some other process through remoting. When the page loads, I init the tree, and in my browser I can see the initialized tree. The problem is that every time that I receive update to tree from the remote process,
4
3346
by: gsb58 | last post by:
Hi! On a form I have a calendar. The form is rezised to 1024x768 (Don't worry - this is a training case) when loaded. Now I want to center the calendar on the form so that its edges are equally far from the upper, right, left and bottom borders of the form. I understand I must use the location property, am I right?
5
2343
by: paul.hester | last post by:
Hi all, I have a custom control with an overridden Render method. Inside this method I'm rendering each control in its collection using their RenderControl method. However, I'm running into a problem in this scenario: <myprefix:mycontrol runat="server"> <%= SomeVariable %> </myprefix:mycontrol>
15
6521
by: rizwanahmed24 | last post by:
Hello i have made a custom control. i have placed a panel on it. I want this panel to behave just like the normal panel. The problem i was having is that the panel on my custom control doesnt accept other controls. The control i drag drop on it becomes the child of my custom control's parent form and not the child of my custom control. Then i added this line "" before my custom control class (i dont know what this line does). Now
0
9564
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10148
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10002
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
7368
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6643
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5270
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5406
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3917
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3528
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.