473,382 Members | 1,441 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,382 software developers and data experts.

Adding and codeing my Module

1
I have a very long list of codes that i was advised to put in a module but don't know where to start from. Also i have a botton in my software that i what to use to be adding tabs when running my program, don't also know how to code that too. Please help...

Codes i want to put in the module:
Expand|Select|Wrap|Line Numbers
  1. Private Sub btnCompute_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnCompute.Click
  2.         'Harmattan semester
  3.         Dim OneHartUnit As Double
  4.         Dim OneHartUnit1 As Double
  5.         Dim OneHartUnit2 As Double
  6.         Dim OneHartUnit3 As Double
  7.         Dim OneHartUnit4 As Double
  8.         Dim OneHartUnit5 As Double
  9.         Dim OneHartUnit6 As Double
  10.         Dim OneHartUnit7 As Double
  11.         Dim OneHartUnit8 As Double
  12.         Dim OneHartGrd As Double
  13.         Dim OneHGradeP As Double
  14.         Dim OneHGradeP1 As Double
  15.         Dim OneHGradeP2 As Double
  16.         Dim OneHGradeP3 As Double
  17.         Dim OneHGradeP4 As Double
  18.         Dim OneHGradeP5 As Double
  19.         Dim OneHGradeP6 As Double
  20.         Dim OneHGradeP7 As Double
  21.         Dim OneHGradeP8 As Double
  22.         Dim SumGP As Double
  23.         Dim SumUnit As Double
  24.         Dim GradePA As Double
  25.         'course one
  26.         'read values from text boxes
  27.         OneHartUnit = Val(txtOneHartUnit_01.Text)
  28.         OneHartGrd = Val(txtOneHartGrd_01.Text)
  29.         'Compute grade point and put in text box
  30.         OneHGradeP1 = OneHartUnit * OneHartGrd
  31.         txtOneHGradeP_01.Text = Format(OneHGradeP1, "00")
  32.         'course two
  33.         'read values from text boxes
  34.         OneHartUnit = Val(txtOneHartUnit_02.Text)
  35.         OneHartGrd = Val(txtOneHartGrd_02.Text)
  36.         'Compute grade point and put in text box
  37.         OneHGradeP2 = OneHartUnit * OneHartGrd
  38.         txtOneHGradeP_02.Text = Format(OneHGradeP2, "00")
  39.         'course three
  40.         'read values from text boxes
  41.         OneHartUnit = Val(txtOneHartUnit_03.Text)
  42.         OneHartGrd = Val(txtOneHartGrd_03.Text)
  43.         'Compute grade point and put in text box
  44.         OneHGradeP3 = OneHartUnit * OneHartGrd
  45.         txtOneHGradeP_03.Text = Format(OneHGradeP3, "00")
  46.         'course four
  47.         'read values from text boxes
  48.         OneHartUnit = Val(txtOneHartUnit_04.Text)
  49.         OneHartGrd = Val(txtOneHartGrd_04.Text)
  50.         'Compute grade point and put in text box
  51.         OneHGradeP4 = OneHartUnit * OneHartGrd
  52.         txtOneHGradeP_04.Text = Format(OneHGradeP4, "00")
  53.         'course five
  54.         'read values from text boxes
  55.         OneHartUnit = Val(txtOneHartUnit_05.Text)
  56.         OneHartGrd = Val(txtOneHartGrd_05.Text)
  57.         'Compute grade point and put in text box
  58.         OneHGradeP = OneHartUnit * OneHartGrd
  59.         txtOneHGradeP_05.Text = Format(OneHGradeP, "00")
  60.         'course six
  61.         'read values from text boxes
  62.         OneHartUnit = Val(txtOneHartUnit_06.Text)
  63.         OneHartGrd = Val(txtOneHartGrd_06.Text)
  64.         'Compute grade point and put in text box
  65.         OneHGradeP = OneHartUnit * OneHartGrd
  66.         txtOneHGradeP_06.Text = Format(OneHGradeP, "00")
  67.         'course seven
  68.         'read values from text boxes
  69.         OneHartUnit = Val(txtOneHartUnit_07.Text)
  70.         OneHartGrd = Val(txtOneHartGrd_07.Text)
  71.         'Compute grade point and put in text box
  72.         OneHGradeP = OneHartUnit * OneHartGrd
  73.         txtOneHGradeP_07.Text = Format(OneHGradeP, "00")
  74.         'course eight
  75.         'read values from text boxes
  76.         OneHartUnit = Val(txtOneHartUnit_08.Text)
  77.         OneHartGrd = Val(txtOneHartGrd_08.Text)
  78.         'Compute grade point and put in text box
  79.         OneHGradeP = OneHartUnit * OneHartGrd
  80.         txtOneHGradeP_08.Text = Format(OneHGradeP, "00")
  81.         'read values from GP text boxes
  82.         OneHGradeP1 = Val(txtOneHGradeP_01.Text)
  83.         OneHGradeP2 = Val(txtOneHGradeP_02.Text)
  84.         OneHGradeP3 = Val(txtOneHGradeP_03.Text)
  85.         OneHGradeP4 = Val(txtOneHGradeP_04.Text)
  86.         OneHGradeP5 = Val(txtOneHGradeP_05.Text)
  87.         OneHGradeP6 = Val(txtOneHGradeP_06.Text)
  88.         OneHGradeP7 = Val(txtOneHGradeP_07.Text)
  89.         OneHGradeP8 = Val(txtOneHGradeP_08.Text)
  90.         'Compute sum grade point and put in text box
  91.         SumGP = OneHGradeP1 + OneHGradeP2 + OneHGradeP3 + OneHGradeP4 + OneHGradeP5 + OneHGradeP6 + OneHGradeP7 + OneHGradeP8
  92.         txtSumGP.Text = Format(SumGP, "00")
  93.         'read values from Unit text boxes
  94.         OneHartUnit1 = Val(txtOneHartUnit_01.Text)
  95.         OneHartUnit2 = Val(txtOneHartUnit_02.Text)
  96.         OneHartUnit3 = Val(txtOneHartUnit_03.Text)
  97.         OneHartUnit4 = Val(txtOneHartUnit_04.Text)
  98.         OneHartUnit5 = Val(txtOneHartUnit_05.Text)
  99.         OneHartUnit6 = Val(txtOneHartUnit_06.Text)
  100.         OneHartUnit7 = Val(txtOneHartUnit_07.Text)
  101.         OneHartUnit8 = Val(txtOneHartUnit_08.Text)
  102.         'Compute sum unit and put in text box
  103.         SumUnit = OneHartUnit1 + OneHartUnit2 + OneHartUnit3 + OneHartUnit4 + OneHartUnit5 + OneHartUnit6 + OneHartUnit7 + OneHartUnit8
  104.         txtSumUnit.Text = Format(SumUnit, "00")
  105.         'read values from text boxes
  106.         SumGP = Val(txtSumGP.Text)
  107.         SumUnit = Val(txtSumUnit.Text)
  108.         'Compute grade point average and put in text box
  109.         GradePA = SumGP / SumUnit
  110.         txtGradePA.Text = Format(GradePA, "0.000")
  111.         txtAnalysis.Text += ControlChars.CrLf + "GPA for Harmattan Semester: " + Format(GradePA, "0.000")
  112.         'Rain semester
  113.         Dim OneRainUnit As Double
  114.         Dim OneRainUnit1 As Double
  115.         Dim OneRainUnit2 As Double
  116.         Dim OneRainUnit3 As Double
  117.         Dim OneRainUnit4 As Double
  118.         Dim OneRainUnit5 As Double
  119.         Dim OneRainUnit6 As Double
  120.         Dim OneRainUnit7 As Double
  121.         Dim OneRainUnit8 As Double
  122.         Dim OneRainGrd As Double
  123.         Dim OneRGradeP As Double
  124.         Dim OneRGradeP1 As Double
  125.         Dim OneRGradeP2 As Double
  126.         Dim OneRGradeP3 As Double
  127.         Dim OneRGradeP4 As Double
  128.         Dim OneRGradeP5 As Double
  129.         Dim OneRGradeP6 As Double
  130.         Dim OneRGradeP7 As Double
  131.         Dim OneRGradeP8 As Double
  132.         Dim SumGP2 As Double
  133.         Dim SumUnit2 As Double
  134.         Dim GradePA2 As Double
  135.         Dim CSumGP As Double
  136.         Dim CSumUnit As Double
  137.         Dim CGPA100 As Double
  138.         'rain course one
  139.         'read values from text boxes
  140.         OneRainUnit = Val(txtOneRainUnit_01.Text)
  141.         OneRainGrd = Val(txtOneRainGrd_01.Text)
  142.         'Compute grade point and put in text box
  143.         OneRGradeP = OneRainUnit * OneRainGrd
  144.         txtOneRGradeP_01.Text = Format(OneRGradeP, "00")
  145.         'rain course two
  146.         'read values from text boxes
  147.         OneRainUnit = Val(txtOneRainUnit_02.Text)
  148.         OneRainGrd = Val(txtOneRainGrd_02.Text)
  149.         'Compute grade point and put in text box
  150.         OneRGradeP = OneRainUnit * OneRainGrd
  151.         txtOneRGradeP_02.Text = Format(OneRGradeP, "00")
  152.         'rain course three
  153.         'read values from text boxes
  154.         OneRainUnit = Val(txtOneRainUnit_03.Text)
  155.         OneRainGrd = Val(txtOneRainGrd_03.Text)
  156.         'Compute grade point and put in text box
  157.         OneRGradeP = OneRainUnit * OneRainGrd
  158.         txtOneRGradeP_03.Text = Format(OneRGradeP, "00")
  159.         'rain course four
  160.         'read values from text boxes
  161.         OneRainUnit = Val(txtOneRainUnit_04.Text)
  162.         OneRainGrd = Val(txtOneRainGrd_04.Text)
  163.         'Compute grade point and put in text box
  164.         OneRGradeP = OneRainUnit * OneRainGrd
  165.         txtOneRGradeP_04.Text = Format(OneRGradeP, "00")
  166.         'rain course five
  167.         'read values from text boxes
  168.         OneRainUnit = Val(txtOneRainUnit_05.Text)
  169.         OneRainGrd = Val(txtOneRainGrd_05.Text)
  170.         'Compute grade point and put in text box
  171.         OneRGradeP = OneRainUnit * OneRainGrd
  172.         txtOneRGradeP_05.Text = Format(OneRGradeP, "00")
  173.         'rain course six
  174.         'read values from text boxes
  175.         OneRainUnit = Val(txtOneRainUnit_06.Text)
  176.         OneRainGrd = Val(txtOneRainGrd_06.Text)
  177.         'Compute grade point and put in text box
  178.         OneRGradeP = OneRainUnit * OneRainGrd
  179.         txtOneRGradeP_06.Text = Format(OneRGradeP, "00")
  180.         'rain course seven
  181.         'read values from text boxes
  182.         OneRainUnit = Val(txtOneRainUnit_07.Text)
  183.         OneRainGrd = Val(txtOneRainGrd_07.Text)
  184.         'Compute grade point and put in text box
  185.         OneRGradeP = OneRainUnit * OneRainGrd
  186.         txtOneRGradeP_07.Text = Format(OneRGradeP, "00")
  187.         'rain course eight
  188.         'read values from text boxes
  189.         OneRainUnit = Val(txtOneRainUnit_08.Text)
  190.         OneRainGrd = Val(txtOneRainGrd_08.Text)
  191.         'Compute grade point and put in text box
  192.         OneRGradeP = OneRainUnit * OneRainGrd
  193.         txtOneRGradeP_08.Text = Format(OneRGradeP, "00")
  194.         'read values from rain GP text boxes
  195.         OneRGradeP1 = Val(txtOneRGradeP_01.Text)
  196.         OneRGradeP2 = Val(txtOneRGradeP_02.Text)
  197.         OneRGradeP3 = Val(txtOneRGradeP_03.Text)
  198.         OneRGradeP4 = Val(txtOneRGradeP_04.Text)
  199.         OneRGradeP5 = Val(txtOneRGradeP_05.Text)
  200.         OneRGradeP6 = Val(txtOneRGradeP_06.Text)
  201.         OneRGradeP7 = Val(txtOneRGradeP_07.Text)
  202.         OneRGradeP8 = Val(txtOneRGradeP_08.Text)
  203.         'Compute sum grade point for rain and put in text box
  204.         SumGP2 = OneRGradeP1 + OneRGradeP2 + OneRGradeP3 + OneRGradeP4 + OneRGradeP5 + OneRGradeP6 + OneRGradeP7 + OneRGradeP8
  205.         txtSumGP2.Text = Format(SumGP2, "00")
  206.         'read values from Unit text boxes
  207.         OneRainUnit1 = Val(txtOneRainUnit_01.Text)
  208.         OneRainUnit2 = Val(txtOneRainUnit_02.Text)
  209.         OneRainUnit3 = Val(txtOneRainUnit_03.Text)
  210.         OneRainUnit4 = Val(txtOneRainUnit_04.Text)
  211.         OneRainUnit5 = Val(txtOneRainUnit_05.Text)
  212.         OneRainUnit6 = Val(txtOneRainUnit_06.Text)
  213.         OneRainUnit7 = Val(txtOneRainUnit_07.Text)
  214.         OneRainUnit8 = Val(txtOneRainUnit_08.Text)
  215.         'Compute sum unit and put in text box
  216.         SumUnit2 = OneRainUnit1 + OneRainUnit2 + OneRainUnit3 + OneRainUnit4 + OneRainUnit5 + OneRainUnit6 + OneRainUnit7 + OneRainUnit8
  217.         txtSumUnit2.Text = Format(SumUnit2, "00")
  218.         'read values from text boxes
  219.         SumGP2 = Val(txtSumGP2.Text)
  220.         SumUnit2 = Val(txtSumUnit2.Text)
  221.         'Compute rain grade point average and put in text box
  222.         GradePA2 = SumGP2 / SumUnit2
  223.         txtGradePA2.Text = Format(GradePA2, "0.000")
  224.         txtAnalysis.Text += ControlChars.CrLf + "GPA for Rain Semester: " + Format(GradePA2, "0.000")
  225.         'read values from text boxes for CGPA
  226.         SumGP = Val(txtSumGP.Text)
  227.         SumUnit = Val(txtSumUnit.Text)
  228.         SumGP2 = Val(txtSumGP2.Text)
  229.         SumUnit2 = Val(txtSumUnit2.Text)
  230.         'Compute cumulative grade point and put in text box
  231.         CSumGP = SumGP + SumGP2
  232.         CSumUnit = SumUnit + SumUnit2
  233.         CGPA100 = CSumGP / CSumUnit
  234.         txtCGPA100.Text = Format(CGPA100, "0.000")
  235.         txtAnalysis.Text += ControlChars.CrLf + "CGPA for Year One: " + Format(CGPA100, "0.000")
  236.  
Nov 12 '08 #1
2 1402
Dököll
2,364 Expert 2GB
Greetings, Canye!

I see what you meant by code, hoooweee! Okay, now, is this school work? need to make sure before we can begin to help tackle this for ya...

What are you trying to achieve with a module? You mentioned tabs, what's the deal there.

(1) You can call a module from your main form or other forms as needed to satisfy part of your program that will be called now and then (repeated items as one example)

(2) You can tell VB to Call the Module, with the state Call Module1, if that'[s the name of yur module

(3) You can do this on form load also if needed.

There are other way to achieve what you need; I'll stopp here to see, perhaps our other experts can jump in...

Do stay tuned though if these or other ideas do not get you started...

Good luck!
Jan 1 '09 #2
QVeen72
1,445 Expert 1GB
Hi,

To Add a Module, In your VB - IDE, Click on menu : Project >> Add Module.
A Module will be added, and then you can shift your Codes to the module.
Not sure, what you mean by adding TABS..?

Regards
Veena
Jan 2 '09 #3

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

Similar topics

1
by: Geoff Biggs | last post by:
Evening all, I'm trying to add a new built-in number data type to Python with its own syntax, so I'm working directly with the interpreter rather than creating my own extension module (side...
11
by: Steven D'Aprano | last post by:
Suppose I create a class with some methods: py> class C: .... def spam(self, x): .... print "spam " * x .... def ham(self, x): .... print "ham * %s" % x .......
17
by: Rune Strand | last post by:
Is it an idea to include a new __filename__ predefined attribute to 2.5, so that __file__ contains the entire path to the module, and __filename__ only the name of the module? For instance it's...
7
by: Alex | last post by:
Hi all, I've found a module that I think will help me combine fields properly, but I'm unsure how to add or use it with Access 2000. Below is the module I'd like to add: ...
4
by: Lee | last post by:
I have come to C# via VB6, and our VB6 apps all had the following header in every class/module/form etc '************************************************************************** ' '* $History:...
18
by: Praveen Ramesh | last post by:
Hi, Is there any way to add the @Assembly reference to the aspx files programmatically from inside a custom control (when it gets dropped on to the page from the toolbox)? I have a custom...
1
by: Christopher W. Douglas | last post by:
I am building a VB.NET application in Visual Studio.NET 2003. I have an existing project with code and forms I want to reuse in this project. If I am copying a module file, then Add Existing Item...
4
by: Bill Nguyen | last post by:
I would like to include a module from another project. When I added existing item, VS copied the module to the current project's folder so that whatever I did to this module doesn't reflect in the...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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.