VB help?
Computer Science and ICT discussion, revision, exam and homework help.
-
Re: VB help?
if you look at the toolbar where u can change the characteristics of each of the components u use in a vb project. for example command buttons, text boxes etc u can see how each of the characterstics is labelled. It is a little confusing at firsrt because as u tried below value is not the correct one for command buttons but caption is sometimes, for example wtih text boxes u would have to use textbox.text to change the content of the textbox... or something like that is a long time since i programmed vb.
anyway consult the toolbar as it gives clues as to how u mite go about changing other characterstics of the objects as well
have fun
-
Re: VB help?
Sorry i don't think i made what i was asking help about clear enough.
I needed to know what the code was for to say If the command button was executed. Is there an equivalent to:
IF Command1.executed Then
Command2.Caption = "Available"
obviously executed isnt the correct characteristic, i just dont know how else to write it. -
Re: VB help?
For CPT3 we used access, no VB at all.
My problem was more complicated than just using the click event of the command button. Ive sorted it now though, thanks anyway.
there were about 20 command buttons on the first form to input the different appointments to the database. what i wanted to do was say if the first command button had been pressed it, the command would change the corresponding command caption to available.
I sorted it with using a hidden text box that on click of the first command entered the name of the command button to the text box and then use select case to check which command button to change the caption of, i couldnt think of any simpler ways but it works. -
Re: VB help?
kk im probably making a total ****** of myself feel free to say if i am
but surely if u want to rewrite wats on the command button name u just have to put:
Private Sub CommandButton1_Click()
CommandButton1.Caption = "hello"
End Sub
if the command buttom is pressed then the capition, the name of the command button cahnges to hello
thats prob not wat u wanted to do bt i thought it was from ur ppost
nevamind otherwise
-
Re: VB help?Thats exactly what I thought he wanted. Apart from it changes CommandButton2. Strange.(Original post by andy_cole2)
kk im probably making a total ****** of myself feel free to say if i am
but surely if u want to rewrite wats on the command button name u just have to put:
Private Sub CommandButton1_Click()
CommandButton1.Caption = "hello"
End Sub
if the command buttom is pressed then the capition, the name of the command button cahnges to hello
thats prob not wat u wanted to do bt i thought it was from ur ppost
nevamind otherwise
-
Re: VB help?
it seems weird because i have never been taught vb but something like this is really easy to do its just logic
lol i dunno maybe it is wat he wanted or maybe not. i mean if it was really wat he was after then you could have it change the title of all the command buttons on that one click...oh the possibilities
have fun
nevamind otherwise
lol i dunno maybe it is wat he wanted or maybe not. i mean if it was really wat he was after then you could have it change the title of all the command buttons on that one click...oh the possibilities