- Joined
- Nov 11, 2004
My final is due on monday and i can't seem to get this data validation to work. I've created a computer building program that would allow the user to select computer components and then have a final order at the end.
The problem that I've come across is when the user would select "next" and go to the next screen/form. I want the program to check and see if all required components have been selected and if not, show a message box letting them know that they need to select the required components.
I have tried:
If radCpu1.Enabled = False Then
MessageBox.Show("please input")
ElseIf radCpu2.Enabled = False Then
MessageBox.Show("please input")
ElseIf radCpu3.Enabled = False Then
MessageBox.Show("please input")
End If
but it doesn't do that operation and allows the user to go to the next screen without selecting a CPU. All help is greatly appreciated and if screenshots, etc would be helpful just say so and I'll throw them up.
*edit* i have it set to "please input" just as a place holder for the text. also, the rad buttons are being used to define variables declared in another form. would that be the issue? i wouldn't think so but, meh.
*second edit*
figured out that i need it to be set to .checked instead of .enabled. now i need to figure out what kind of if statement i want to use or if i want to base the if statement off the variables instead of the state of the rad buttons. i.e. if intcpu = 0 then blah blah instead of if radcpu = check then blah blah.
*third edit*
i figured out that i can have it check the values for the variables in the final form to see if there is anything in there. if it's 0, then it hasn't been selected and needs a value entered (can't build a computer without a cpu). so it's all set up and working! woot! if i come up with something else i can't figure out, i'll post it here.
*fourth edit*
what's a quick easy way to have the messagebox.show display a picture and nothing else?
The problem that I've come across is when the user would select "next" and go to the next screen/form. I want the program to check and see if all required components have been selected and if not, show a message box letting them know that they need to select the required components.
I have tried:
If radCpu1.Enabled = False Then
MessageBox.Show("please input")
ElseIf radCpu2.Enabled = False Then
MessageBox.Show("please input")
ElseIf radCpu3.Enabled = False Then
MessageBox.Show("please input")
End If
but it doesn't do that operation and allows the user to go to the next screen without selecting a CPU. All help is greatly appreciated and if screenshots, etc would be helpful just say so and I'll throw them up.
*edit* i have it set to "please input" just as a place holder for the text. also, the rad buttons are being used to define variables declared in another form. would that be the issue? i wouldn't think so but, meh.
*second edit*
figured out that i need it to be set to .checked instead of .enabled. now i need to figure out what kind of if statement i want to use or if i want to base the if statement off the variables instead of the state of the rad buttons. i.e. if intcpu = 0 then blah blah instead of if radcpu = check then blah blah.
*third edit*
i figured out that i can have it check the values for the variables in the final form to see if there is anything in there. if it's 0, then it hasn't been selected and needs a value entered (can't build a computer without a cpu). so it's all set up and working! woot! if i come up with something else i can't figure out, i'll post it here.
*fourth edit*
what's a quick easy way to have the messagebox.show display a picture and nothing else?
Last edited: