Survey - Checklist - Status Report

Looking for best format for a status report

Page 1 of 1

13 Replies - 1697 Views - Last Post: 23 September 2009 - 11:21 PM Rate Topic: -----

#1 wasatchu  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 18
  • Joined: 01-September 09

Survey - Checklist - Status Report

Posted 14 September 2009 - 01:31 PM

I am planning a three form checklist/status report for a FEED template. Each form will address a different FEL. FEL1 is really a simple checklist and is easily dealt with using the Windows Form.

My question is there a better structure to handle the more complex FEL2 and FEL3, like the web page? FEL2 will have approximately 20 questions and FEL3 will have about 50. I am still undecided whether to use radio buttons (radio button list, which I do not understand yet) or text boxes that will take a value between 0 and 10. I may weight the questions to give an overall percent complete that I can show on the progress bar or some such.

If there is a better structure than the Windows form, can it and the Windows Form be linked? If not, will abandon efforts to complete current FEL1. Conceptually, you cannot start FEL2 until you have completed FEL1, and FEL3 until FEL2 is complete.

Any thoughts appreciated. This forum is a godsend.

Public Class FrmFEL1
	Dim PctCmpt As New ProgressBar()

	Private Sub CboxChrtr_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CboxChrtr.CheckedChanged
		If True Then PctCmpt.Value = 10
	End Sub

	Private Sub CBoxPE_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CBoxPE.CheckedChanged
		If True Then PctCmpt.Value = 25
	End Sub

	Private Sub CBoxPCM_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CBoxPCM.CheckedChanged
		If True Then PctCmpt.Value = 35
	End Sub

	Private Sub CBoxPL_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CBoxPL.CheckedChanged
		If True Then PctCmpt.Value = 50
	End Sub

	Private Sub TxtBasis_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TxtBasis.TextChanged
		If CboxChrtr.Checked = True Then TxFEL1.Text = "10"
		If CBoxPE.Checked = True Then TxFEL1.Text = "25"
		If CBoxPE.Checked And CBoxPCM.Checked Then TxFEL1.Text = "35"
	End Sub
End Class



This is what I have so far. It is no working at all. No values appear when boxes checked.

Would like a value for each checkbox that can be added in in order to get a total. That total to be added to the percent complete (TxFEL1).

This post has been edited by wasatchu: 15 September 2009 - 12:47 PM


Is This A Good Question/Topic? 0
  • +

Replies To: Survey - Checklist - Status Report

#2 mark.bottomley  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 176
  • View blog
  • Posts: 990
  • Joined: 22-April 09

Re: Survey - Checklist - Status Report

Posted 14 September 2009 - 09:20 PM

Other possible choices are up/down textboxes allowing entry of numbers in a specific range. You could also use the horizontal slider with 0..10 as the increments - 0 is unanswered.
Was This Post Helpful? 0
  • +
  • -

#3 wasatchu  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 18
  • Joined: 01-September 09

Re: Survey - Checklist - Status Report

Posted 17 September 2009 - 07:33 AM

View Postmark.bottomley, on 14 Sep, 2009 - 08:20 PM, said:

Other possible choices are up/down textboxes allowing entry of numbers in a specific range. You could also use the horizontal slider with 0..10 as the increments - 0 is unanswered.



Thanks Mark for the suggestion(s). Not sure what they are just yet, but will find out. My concern was with the amount of verbiage shown on each 'page'. With 20-50 checkboxes, is the Windows Function the best venue?

My current model is getting an error message that I do not understand.

Error message:

System.InvalidOperationException was unhandled
Message="An error occurred creating the form. See Exception.InnerException for details. The error is: Object reference not set to an instance of an object."
Source="FEEDstat"
StackTrace:
at FEEDstat.My.MyProject.MyForms.Create__Instance__[T](T Instance) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 190
at FEEDstat.My.MyProject.MyForms.get_FrmFEL1()
at FEEDstat.My.MyApplication.OnCreateMainForm() in D:\My Documents\Visual Studio 2008\Projects\FEEDstat\FEEDstat\FEEDstat\My Project\Application.Designer.vb:line 35
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine)
at FEEDstat.My.MyApplication.Main(String[] Args) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 81
at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException: System.NullReferenceException
Message="Object reference not set to an instance of an object."
Source="FEEDstat"
StackTrace:
at FEEDstat.FrmFEL1..ctor() in D:\My Documents\Visual Studio 2008\Projects\FEEDstat\FEEDstat\FEEDstat\Form1.vb:line 4
InnerException:


Public Class FrmFEL1

	Dim c1, c2, c3, c4 As Integer
	Dim tB As Integer = CInt(TxtBasis.Text)
	Dim PctCmpl As Integer = c1 + c2 + c3 + c4 + tB

	Public Sub FrmFEL1()

		Bar1.Value = PctCmpl
		'TxFEL1.Text = CStr(Bar1.Value)
		TxFEL1.Text = CStr(PctCmpl)

	End Sub

	Private Sub CboxChrtr_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CboxChrtr.CheckedChanged

		If CboxChrtr.Checked = True Then c1 = 10 Else c1 = 0

	End Sub

	Private Sub CBoxPE_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CBoxPE.CheckedChanged

		If CBoxPE.Checked = True Then c2 = 15 Else c2 = 0

	End Sub

	Private Sub CBoxPCM_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CBoxPCM.CheckedChanged

		If CBoxPCM.Checked = True Then c3 = 10 Else c3 = 0

	End Sub

	Private Sub CBoxPL_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CBoxPL.CheckedChanged

		If CBoxPL.Checked = True Then c4 = 15 Else c4 = 0

	End Sub

End Class


This post has been edited by wasatchu: 17 September 2009 - 10:25 AM

Was This Post Helpful? 0
  • +
  • -

#4 motcom  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 290
  • View blog
  • Posts: 1,371
  • Joined: 16-June 08

Re: Survey - Checklist - Status Report

Posted 17 September 2009 - 08:01 AM

Hey Wasatchu
I made you a project that uses a checked listbox with a progress bar.

You will see its less code and not so complex. Maybe it can help.

Here is the code, but rather download it at check the settings of the progress bar an for all the controls on the form

Public Class Form1

	Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
		'ADDING 10 QUESTIONS HERE, YOU CAN CHANGE IT TO WHAT EVER.
		'OR ADD THEM THROUGH THE PROPERTIES WINDOW IN THE DESIGNER.
		chkQuestions.Items.Add("Question 1")
		chkQuestions.Items.Add("Question 2")
		chkQuestions.Items.Add("Question 3")
		chkQuestions.Items.Add("Question 4")
		chkQuestions.Items.Add("Question 5")
		chkQuestions.Items.Add("Question 6")
		chkQuestions.Items.Add("Question 7")
		chkQuestions.Items.Add("Question 8")
		chkQuestions.Items.Add("Question 9")
		chkQuestions.Items.Add("Question 10")

		'SETTING THE PROGRESS BAR SETTINGS
		prgProgress.Maximum = chkQuestions.Items.Count
		prgProgress.Minimum = 0

		'COUNTING HOW MANY ITEMS ARE CHECKED
		CalculateHowManyItems()
	End Sub

	Private Sub chkQuestions_ItemCheck(ByVal sender As System.Object, ByVal e As System.Windows.Forms.ItemCheckEventArgs) Handles chkQuestions.ItemCheck
		If e.NewValue = CheckState.Checked Then
			prgProgress.Value += 1
		Else
			prgProgress.Value -= 1
		End If
		
	End Sub

	Private Sub CalculateHowManyItems()
		Dim TotalItemsChecked As Integer
		Dim TotalItems As Integer
		Dim x As Integer

		With chkQuestions
			TotalItemsChecked = .CheckedItems.Count
			TotalItems = .Items.Count
		End With

		lblItemOfHowMany.Text = CStr(TotalItemsChecked) & " of " & CStr(TotalItems) & " are checked"

		'ADDED A BIT OF CODE FOR YOU SO YOU CAN SEE WHAT THE VALUES OF THE CHECKED ITEMS ARE

		lstCheckedItems.Items.Clear()

		For x = 0 To chkQuestions.CheckedItems.Count - 1
			lstCheckedItems.Items.Add(chkQuestions.CheckedItems(x).ToString)
		Next
	End Sub

	Private Sub chkQuestions_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles chkQuestions.MouseUp
		CalculateHowManyItems()
	End Sub

   
End Class


Was This Post Helpful? 1
  • +
  • -

#5 wasatchu  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 18
  • Joined: 01-September 09

Re: Survey - Checklist - Status Report

Posted 17 September 2009 - 09:26 AM

View Postmotcom, on 17 Sep, 2009 - 07:01 AM, said:

Hey Wasatchu
I made you a project that uses a checked listbox with a progress bar.

You will see its less code and not so complex. Maybe it can help.

Here is the code, but rather download it at check the settings of the progress bar an for all the controls on the form

Public Class Form1

	Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
		'ADDING 10 QUESTIONS HERE, YOU CAN CHANGE IT TO WHAT EVER.
		'OR ADD THEM THROUGH THE PROPERTIES WINDOW IN THE DESIGNER.
		chkQuestions.Items.Add("Question 1")
		chkQuestions.Items.Add("Question 2")
		chkQuestions.Items.Add("Question 3")
		chkQuestions.Items.Add("Question 4")
		chkQuestions.Items.Add("Question 5")
		chkQuestions.Items.Add("Question 6")
		chkQuestions.Items.Add("Question 7")
		chkQuestions.Items.Add("Question 8")
		chkQuestions.Items.Add("Question 9")
		chkQuestions.Items.Add("Question 10")

		'SETTING THE PROGRESS BAR SETTINGS
		prgProgress.Maximum = chkQuestions.Items.Count
		prgProgress.Minimum = 0

		'COUNTING HOW MANY ITEMS ARE CHECKED
		CalculateHowManyItems()
	End Sub

	Private Sub chkQuestions_ItemCheck(ByVal sender As System.Object, ByVal e As System.Windows.Forms.ItemCheckEventArgs) Handles chkQuestions.ItemCheck
		If e.NewValue = CheckState.Checked Then
			prgProgress.Value += 1
		Else
			prgProgress.Value -= 1
		End If
		
	End Sub

	Private Sub CalculateHowManyItems()
		Dim TotalItemsChecked As Integer
		Dim TotalItems As Integer
		Dim x As Integer

		With chkQuestions
			TotalItemsChecked = .CheckedItems.Count
			TotalItems = .Items.Count
		End With

		lblItemOfHowMany.Text = CStr(TotalItemsChecked) & " of " & CStr(TotalItems) & " are checked"

		'ADDED A BIT OF CODE FOR YOU SO YOU CAN SEE WHAT THE VALUES OF THE CHECKED ITEMS ARE

		lstCheckedItems.Items.Clear()

		For x = 0 To chkQuestions.CheckedItems.Count - 1
			lstCheckedItems.Items.Add(chkQuestions.CheckedItems(x).ToString)
		Next
	End Sub

	Private Sub chkQuestions_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles chkQuestions.MouseUp
		CalculateHowManyItems()
	End Sub

   
End Class




Thanks Motcom, but my questions/Checkboxes will not have equal value. Any idea what the error code(s) mean(s)? I do need to find a way to simplify, because this will become unwieldy after a few more checkboxes - almost there already. With your permission, I would like to retain your code. Again, thanks.

This post has been edited by wasatchu: 17 September 2009 - 09:27 AM

Was This Post Helpful? 0
  • +
  • -

#6 motcom  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 290
  • View blog
  • Posts: 1,371
  • Joined: 16-June 08

Re: Survey - Checklist - Status Report

Posted 18 September 2009 - 12:03 AM

Hey wasatchu,

could you post a copy of your project? maybe i did not understand your question properly.

You can keep my code no problem.

motcom
Was This Post Helpful? 0
  • +
  • -

#7 wasatchu  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 18
  • Joined: 01-September 09

Re: Survey - Checklist - Status Report

Posted 18 September 2009 - 06:42 AM

Motcom

This is what I have for FEL1 (see attached file). The progress bar will probably be dropped, it was only a 'learning exercise'. I expect FEL2 and 3 to be a combination of checkboxes and radio buttons with the values of each element/question to have different values.

At 20-50 entries, the current method will collapse on itself, so something like you suggested will probably be adopted. The differing 'weights' for each element becomes the main hurdle.

Really do appreciate your interest. It is humbling to see well-crafted code.

View Postmotcom, on 17 Sep, 2009 - 11:03 PM, said:

Hey wasatchu,

could you post a copy of your project? maybe i did not understand your question properly.

You can keep my code no problem.

motcom

Attached File(s)


Was This Post Helpful? 0
  • +
  • -

#8 motcom  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 290
  • View blog
  • Posts: 1,371
  • Joined: 16-June 08

Re: Survey - Checklist - Status Report

Posted 18 September 2009 - 07:11 AM

Sorry wasatchu

it says the file is corrupt

Try uploading again.

Will be available on monday again... :^:
Was This Post Helpful? 0
  • +
  • -

#9 wasatchu  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 18
  • Joined: 01-September 09

Re: Survey - Checklist - Status Report

Posted 21 September 2009 - 08:38 AM

Motcom;

Let's try this again. I appreciate your patience. Tried another zip utility. Firefox crashed.

Attached File(s)

  • Attached File  FEL1.zip (74.5K)
    Number of downloads: 46

Was This Post Helpful? 0
  • +
  • -

#10 motcom  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 290
  • View blog
  • Posts: 1,371
  • Joined: 16-June 08

Re: Survey - Checklist - Status Report

Posted 22 September 2009 - 12:58 AM

Hey wasatchu

Good news,

I fixed up your project and added some more options....

But First of all the error.

-> You had a sub callded exactly the same as your classname. This you must avoid.

Next The new stuff...

1. I added a few more subs that allow you to use radio buttons as well. However, they must be in a group box.
(in any case normally radio buttons are grouped)
2. The programm will now check to see if a check box is checked or if a radio button is checked and will calculate
the completion.
3. I added a button to clear all the selections (just thought it might be usefull)
4. Note that all your conrols are in a panel. I gave it a border but you don't have to. My subs will check all the
Controls in that panel and do its calculations. You could add more panels and it will check them aswell.
5. ;) Very neat... You can add as many checkboxes, and radio buttions as you like and you don't need to worry
about the "ckeckedchanged" event as i wired it up as well.

I actually like this code i have written :P

Hope this will do the trick for you......

Motcom
Was This Post Helpful? 1

#11 wasatchu  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 18
  • Joined: 01-September 09

Re: Survey - Checklist - Status Report

Posted 22 September 2009 - 09:35 AM

Motcom;

Thanks again. Been reviewing your code. I would never of thought of something like that. How do I change the 'weighting' of the various elements? Seems to be 9.09% for all check boxes. Need to be able to adjust the value of the elements.

Tried to change the sub name, still get same error message.
Was This Post Helpful? 0
  • +
  • -

#12 motcom  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 290
  • View blog
  • Posts: 1,371
  • Joined: 16-June 08

Re: Survey - Checklist - Status Report

Posted 22 September 2009 - 11:14 PM

Hi Wasatchu,

On the error, you should also avoid this line of code.

Dim tB As Integer = CInt(TxtBasis.Text)



At class level you can not use any values of your textboxes, buttons etc.
The reason is:
Every class must have a sub new()
Now if this class is a form, you will find that in sub new() is a InitializeComponent() sub, this sub builds all the controls that are on the form. Now the varialbe delcaration at class level happens before the initializecomponent() sub.
This means that Your above code will try to get a value from TxtBasis.Text and there is not yet a value.
You should put that code into your formload event. And validate that TxtBasis.Text is actually a integer.

If the error still persists, make a copy of the project i posted and try again..

Next
What do you mean about weigthing?

I presume its like this

1. Checkbox 1 = 40%
2. Checkbox 2 = 20%
3. Checkbox 3 = 20%
4. Checkbox 4 = 20%

Total = 100%

If it is, then you could use the "Tag" Property of the check boxes/radio buttons and assign them a value ant then total them.

This post has been edited by motcom: 22 September 2009 - 11:23 PM

Was This Post Helpful? 1
  • +
  • -

#13 wasatchu  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 18
  • Joined: 01-September 09

Re: Survey - Checklist - Status Report

Posted 23 September 2009 - 01:48 PM

I re-wrote the program. Now no error message but no calculations either. Will keepworking

"Next
What do you mean about weigting?

I presume its like this

1. Checkbox 1 = 40%
2. Checkbox 2 = 20%
3. Checkbox 3 = 20%
4. Checkbox 4 = 20%

Total = 100%

If it is, then you could use the "Tag" Property of the check boxes/radio buttons and assign them a value ant then total them."

This is it exactly. Was reading Murach's, but 'tags' seemed to apply only to passing info from one form to another. I will experiment with it because it will make things a lot simpler for when the form has to be changed to reflect different industries.

You are very patient, thanks again
Was This Post Helpful? 0
  • +
  • -

#14 motcom  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 290
  • View blog
  • Posts: 1,371
  • Joined: 16-June 08

Re: Survey - Checklist - Status Report

Posted 23 September 2009 - 11:21 PM

No problem...

Hope this showed you what is possible with dot.net :)
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1