473,385 Members | 1,483 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Control Tab Possibllities

166 100+
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_AfterUpdate()
Select Case matTypeID

Case 1

Me.materialID.Requery
Me!TabCtl1.Pages(0).SetFocus

Case 2
Me.materialID.Requery
Me.Tabctl1.Pages.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
56 4964
csolomon
166 100+
I was able to do everything listed, with no issues. I only tried to edit a record, not add one...that works.

@OldBirdman
Mar 26 '09 #51
OldBirdman
675 512MB
Except that your subform is limited in the fields it displays, does your tab control work correctly as you wanted in post #1?

Also, do we meet the desire that there only be one subform?

I see 3 issues left:
1) Complete testing in this limited version
2) Convert to the full subform display
3) Add "Footer" and get it working

Do you have anything to add to this list?
Mar 26 '09 #52
csolomon
166 100+
Yes it does! And using one form!!!

I noticed that the first time I go into design view, I see all my calculations, but when I change tabs, they say #NAME?

Those are the only issues left. The footer's calculations only are used for the cements values. I have a lot of unbound text boxes, representing different values that are used in calculations.

@OldBirdman
Mar 26 '09 #53
csolomon
166 100+
OldBirdMan,

It's about that time! I really appreciate you taking the time out (one step at a time :)) to explain things to me and ensure that I got it right. Hopefully we can finish this tomorrow as my work day is over.

Thank you again. I will respond to you on tomorrow.
Mar 26 '09 #54
ChipR
1,287 Expert 1GB
Thanks for taking over OldBirdMan. I'm sorry I couldn't be of more help, but I'm knee deep in an urgent project, and can never seem to explain things clearly.
Mar 26 '09 #55
OldBirdman
675 512MB
#Name means that the control is not bound. The subform controls need to be bound to the query. This is done by seting the control's ControlSource property. If this works for testing, leave it alone, as we will be at item 2) next.

One step at a time:
1) Open the backup copy you made in Post #51, step 1. Copy ONE of your subforms, and then switch to your current database and paste it onto your form = F_Test2_MixDesign, not into your tab control
2) Drag your new subform into your tab control, as you did in post #51. Make sure your tab control is large enough for both subforms.
3) Next post, I need to know the name of your new subform
3) Between lines 7 & 8 of Private Sub tabCtl1_Change() you will need to assign a RecordSource to your new subform.
a) Line 7.1 strSQL = "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 "
b) Notice that all the double-quotes(") inside other double-quotes were changed to single-quotes(')
c) Line 7.2 strSQL = strSQL & "FROM Material INNER JOIN (MixSample INNER JOIN MatType ON MixSample.matTypeID=" & iTab & ") ON Material.materialID=MixSample.materialID "
d) Line 7.3 strSQL = strSQL & "WHERE (((MixSample.DM_Mix)=[Forms]![F_Test2_MixDesign]![DM_Mix])) "
e) Line 7.4 strSQL = strSQL & "ORDER BY ???;" if you need these in some order, otherwise the semicolon(;) goes at the end of the FROM Clause
f) Line 7.5 Me!YourSubformName.Form.RecordSource = strSQL
g) Test it to death
Mar 26 '09 #56
csolomon
166 100+
Hi OldBirdman,

Again I appreciate your assistance. Back to work!

1) CHECK
2)CHECK
Expand|Select|Wrap|Line Numbers
  1. 3) Next post, I need to know the name of your new subform
The name is SF_Test_TestMixSample
3) a. Here is what I have:

Expand|Select|Wrap|Line Numbers
  1. Private Sub tabCtl1_Change()
  2. Dim strSQL As String
  3. Dim iTab As Integer
  4. MsgBox "Tab chosen is " & TabCtl1.Pages(TabCtl1).Name
  5. iTab = Mid(TabCtl1.Pages(TabCtl1).Name, 4, 1)
  6. 'strSQL = "SELECT * FROM Material WHERE matTypeID=" & iTab & " ORDER BY material;"
  7. strSQL = "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"
  8. strSQL = strSQL & "FROM Material INNER JOIN (MixSample INNER JOIN MatType ON MixSample.matTypeID=" & iTab & ") ON Material.materialID=MixSample.materialID "
  9. strSQL = strSQL & "WHERE (((MixSample.DM_Mix)=[Forms]![F_Test2_MixDesign]![DM_Mix]);"
  10. Me!SF_Test_TestMixSample.Form.RecordSource = strSQL
  11. End Sub
The bold line is returning an error. The error is a syntax error


@OldBirdman
Mar 30 '09 #57

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

Similar topics

6
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...
6
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"...
2
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
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...
5
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...
2
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...
4
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...
5
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...
15
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.