473,407 Members | 2,314 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,407 software developers and data experts.

CommandButton for further processing

Hi,

I want to set a CommandButton (Click - Event) to let the programm code
(below) progress.

The question is how is that exactly to do on the point.

The as boolean declared variable "PROCEED" is turning "FALSE" after
complieting While Wend - Loop and hereafter is coming the Text on the
TextBox that

can be operated through the User. The User had completed his task and
would have after activating CommandButton to let the programm run
further.

When I have added that code defining the CommandClick - Event to run
further,

Public Sub command1_click()

PROCEED = True

End Sub

It was fruitless!

The programm has to carry on if the user action (Click Event) has turnt
the variable "true", but it doesn't anyway.

What would bet he the right apprroach to it?

Thanks

Leon Galushko

Public Sub form_load()

'declared variables"

....

While End <True

If IsNumeric(Right(strTemp, 1)) = False Then

Text1 = Text1 + strTemp + " " + vbCrLf + t.ReadLine + " " + vbCrLf

Else: Print #1, strTemp

End If

strTemp = t.ReadLine

str2 = RTrim(strTemp)

proz = Right(str2, 6)

schl1 = (Left(str2, 17) & " " & Right(str2, 6))

schl2 = (Left(str2, 19) & " " & Right(str2, 6))

schl3 = (Left(str2, 18) & " " & Right(str2, 6))

schl4 = (Left(str2, 20) & " " & Right(str2, 6))

If schl1 = schluss1 Or schl2 = schluss2 Or schl3 = schluss3 Or schl4 =
schluss4 Then Ende = True

Wend

Close #1

Ende = False

PROCEED = False
!!! - COMMAND BUTTON CLICK "PROCEED" should take True - Value to make
further

If PROCEDED = True Then

strTemp = t.ReadLine

' weiterer Quellcode....

.............

...........

Public Sub Einlesen_Click()

Open strFile For Append As #1

str0 = Text1 + " " + vbCrLf

Print #1, str0

Close #1

Text1 = ""

End Sub


Jan 3 '08 #1
9 1403
"leon Galushko" <le*************@rwth-aachen.deschrieb
Hi,

I want to set a CommandButton (Click - Event) to let the programm
code (below) progress.
Have a look at one of the microsoft.public.vb.* group because this is a
VB.Net group.
Armin

Jan 3 '08 #2
On Jan 3, 10:32*pm, "leon Galushko" <leonid.galus...@rwth-aachen.de>
wrote:
Hi,

I want to set a CommandButton (Click - Event) to let the programm code
(below) progress.

The question is how is that exactly to do on the point.

The as boolean declared variable "PROCEED" is turning "FALSE" after
complieting *While Wend - Loop and hereafter is coming the Text on the
TextBox that

can be operated through the User. The User had completed his task and
would have after activating CommandButton to let the programm run
further.

When I have added that code defining the CommandClick - Event to run
further,

* * * * * * Public Sub command1_click()

PROCEED = True

End Sub

* * * * * * * * * * * * * * * * * *It was fruitless!

The programm has to carry on if the user action (Click Event) has turnt
the variable "true", but it doesn't anyway.

What would bet he the right apprroach to it?

Thanks

Leon Galushko

Public Sub form_load()

* * * * * * * * * * * * 'declared variables"

* * * * * * * * * * * *....

While End <True

If IsNumeric(Right(strTemp, 1)) = False Then

Text1 = Text1 + strTemp + " " + vbCrLf + t.ReadLine + " " + vbCrLf

Else: Print #1, strTemp

End If

strTemp = t.ReadLine

str2 = RTrim(strTemp)

proz = Right(str2, 6)

schl1 = (Left(str2, 17) & " " & Right(str2, 6))

schl2 = (Left(str2, 19) & " " & Right(str2, 6))

schl3 = (Left(str2, 18) & " " & Right(str2, 6))

schl4 = (Left(str2, 20) & " " & Right(str2, 6))

If schl1 = schluss1 Or schl2 = schluss2 Or schl3 = schluss3 Or schl4=
schluss4 Then Ende = True

Wend

Close #1

Ende = False

* * * * * * * * * * * * * * * * * * * * * * * * * PROCEED = False * *

!!! - COMMAND BUTTON CLICK "PROCEED" should take True - Value to make
further

If PROCEDED = True Then
This may be a mistype as you wrote "PROCEDED" instead of "PROCEED"
which you probably meant.
strTemp = t.ReadLine

' weiterer Quellcode....

............

..........

Public Sub Einlesen_Click()

Open strFile For Append As #1

str0 = Text1 + " " + vbCrLf

Print #1, str0

Close #1

Text1 = ""

End Sub
your code does not include boolean declaration which must contain as:

Dim PROCEED as Boolean

in declaration area.

Regards.
Jan 4 '08 #3
leon Galushko wrote:
Public Sub form_load()
'declared variables"

While End <True
Do you mean

While Ende<>True

-or perhaps-

While Not(Ende)

Andrew
Jan 4 '08 #4

Hi,

The problem seems to be leying on the different Sub Routines.
I had declared in the Reed_Click event section the Boolean variable
"proceed", and in the Main Sub Form_load is the right wording too.
I think indeed the code stops on the point "proceed = False" because
thereby on the Reed_Click Event the value returning should taken place,
it does not carry on to the Main_Sub again, say, its hanging on the
point with the unchanged boolean variable.
I am looking for the approach how could one to let change the value of
the (boolean)variable in the course of the Click_Event.
I mean, Click Event happens and that should lead to the statement
proceed = true, AND THAT in the Main Routine Form_load and not in the
Click_Event Read_Click!
I suppose that task is something of the better level of programming
skills that i am yet lacking, but I would be gratefull just for the
idea!
Regards

On Jan 3, 10:32*pm, "leon Galushko" <leonid.galus...@rwth-aachen.de>
wrote:
Hi,

I want to set a CommandButton (Click - Event) to let the programm code
(below) progress.

The question is how is that exactly to do on the point.

The as boolean declared variable "PROCEED" is turning "FALSE" after
complieting *While Wend - Loop and hereafter is coming the Text on the
TextBox that

can be operated through the User. The User had completed his task and
would have after activating CommandButton to let the programm run
further.

When I have added that code defining the CommandClick - Event to run
further,

* * * * * * Public Sub command1_click()

PROCEED = True

End Sub

* * * * * * * * * * * * * * * * * *It was fruitless!

The programm has to carry on if the user action (Click Event) has
turnt
the variable "true", but it doesn't anyway.

What would bet he the right apprroach to it?

Thanks

Leon Galushko

Public Sub form_load()

* * * * * * * * * * * * 'declared variables"

* * * * * * * * * * * *....

While End <True

If IsNumeric(Right(strTemp, 1)) = False Then

Text1 = Text1 + strTemp + " " + vbCrLf + t.ReadLine + " " + vbCrLf

Else: Print #1, strTemp

End If

strTemp = t.ReadLine

str2 = RTrim(strTemp)

proz = Right(str2, 6)

schl1 = (Left(str2, 17) & " " & Right(str2, 6))

schl2 = (Left(str2, 19) & " " & Right(str2, 6))

schl3 = (Left(str2, 18) & " " & Right(str2, 6))

schl4 = (Left(str2, 20) & " " & Right(str2, 6))

If schl1 = schluss1 Or schl2 = schluss2 Or schl3 = schluss3 Or schl4 =
schluss4 Then Ende = True

Wend

Close #1

Ende = False

* * * * * * * * * * * * * * * * * * * * * * * * * PROCEED = False * *

!!! - COMMAND BUTTON CLICK "PROCEED" should take True - Value to make
further

If PROCEDED = True Then
This may be a mistype as you wrote "PROCEDED" instead of "PROCEED"
which you probably meant.
strTemp = t.ReadLine

' weiterer Quellcode....

............

..........

Public Sub Read_Click()
Dim proceed as Boolea
Open strFile For Append As #1

str0 = Text1 + " " + vbCrLf

Print #1, str0

Close #1

Text1 = ""

Proceed = true
>
End Sub
your code does not include boolean declaration which must contain as:

Dim PROCEED as Boolean

in declaration area.

Regards.

Jan 4 '08 #5

Hi,
No, i meant indeed While / Wend Loop, which is not the cause for my
problem.
The Question is, how could I get examined in the form_load section
whether the click event (CommanBox) had taken place. If that was the
case, the boolean variable should "turn true" and so let the code go on.
Public Sub form_load()
Dim proceed as boolean
'declared variables"
Proceed = false
While End <True
.......
If Click_event (command1) = YES then

Proceed = true

If proceed = true then

...further processing.....
Do you mean

While Ende<>True

-or perhaps-

While Not(Ende)

Andrew
Jan 4 '08 #6
On Jan 4, 7:39 pm, "leon Galushko" <leonid.galus...@rwth-aachen.de>
wrote:
Hi,
No, i meant indeed While / Wend Loop, which is not the cause for my
problem.
The Question is, how could I get examined in the form_load section
whether the click event (CommanBox) had taken place. If that was the
case, the boolean variable should "turn true" and so let the code go on.
Public Sub form_load()

Dim proceed as boolean
'declared variables"

Proceed = false
While End <True

......

If Click_event (command1) = YES then

Proceed = true

If proceed = true then

...further processing.....

Do you mean

While Ende<>True

-or perhaps-

While Not(Ende)

Andrew
IIUC from the confusing parts, you may want to display command button
as visible as long as "proceed=true"?
Dim proceed as boolean
While proceed=true
button1.visible = true
End While

here is button1 is your command button and don't forget to hide it by
default till proceed value returns the boolean as true.

Hope this helps.
Jan 4 '08 #7
On Fri, 4 Jan 2008 18:39:25 +0100, "leon Galushko"
<le*************@rwth-aachen.dewrote:
>
Hi,
No, i meant indeed While / Wend Loop, which is not the cause for my
problem.
The Question is, how could I get examined in the form_load section
whether the click event (CommanBox) had taken place. If that was the
case, the boolean variable should "turn true" and so let the code go on.
>Public Sub form_load()
Dim proceed as boolean
> 'declared variables"

Proceed = false
>While End <True

......
If Click_event (command1) = YES then

Proceed = true

If proceed = true then

...further processing.....
Do you mean

While Ende<>True

-or perhaps-

While Not(Ende)

Andrew
You can not loop in the Load event waiting for the user to press the
button. The Load event code must exit.

Instead put the code you want to execute in a Sub and call it from the
button's Click event.
Jan 4 '08 #8

Thank you for your help!

But I might suggest that I had been mistaken.

Once more: click on the CommandButton should produce the change of value
of the given variable(proceed). The question is, how I could get
examined in course of form_load section and NOT in the
CommanButton_Click section, whether the CommandButton had been just
clicked.

Something like that:

Public form_load()

If Command1_Click = True Then
proceed = true

if proceed = true then

...further processing

That is of course a false code, but I intended just to make clear my
purpose.
Thanks
Leon

On Jan 4, 7:39 pm, "leon Galushko" <leonid.galus...@rwth-aachen.de>
wrote:
Hi,
No, i meant indeed While / Wend Loop, which is not the cause for my
problem.
The Question is, how could I get examined in the form_load section
whether the click event (CommanBox) had taken place. If that was the
case, the boolean variable should "turn true" and so let the code go
on.
>
Public Sub form_load()

Dim proceed as boolean
'declared variables"

Proceed = false
While End <True

......

If Click_event (command1) = YES then

Proceed = true

If proceed = true then

...further processing.....

Do you mean

While Ende<>True

-or perhaps-

While Not(Ende)

Andrew
IIUC from the confusing parts, you may want to display command button
as visible as long as "proceed=true"?
Dim proceed as boolean
While proceed=true
button1.visible = true
End While

here is button1 is your command button and don't forget to hide it by
default till proceed value returns the boolean as true.

Hope this helps.

Jan 4 '08 #9
On Jan 4, 8:20 pm, "leon Galushko" <leonid.galus...@rwth-aachen.de>
wrote:
Thank you for your help!

But I might suggest that I had been mistaken.

Once more: click on the CommandButton should produce the change of value
of the given variable(proceed). The question is, how I could get
examined in course of form_load section and NOT in the
CommanButton_Click section, whether the CommandButton had been just
clicked.

Something like that:

Public form_load()

If Command1_Click = True Then
proceed = true

if proceed = true then

...further processing

That is of course a false code, but I intended just to make clear my
purpose.
Thanks
Leon

On Jan 4, 7:39 pm, "leon Galushko" <leonid.galus...@rwth-aachen.de>
wrote:
Hi,
No, i meant indeed While / Wend Loop, which is not the cause for my
problem.
The Question is, how could I get examined in the form_load section
whether the click event (CommanBox) had taken place. If that was the
case, the boolean variable should "turn true" and so let the code go
on.
Public Sub form_load()
Dim proceed as boolean
'declared variables"
Proceed = false
While End <True
......
If Click_event (command1) = YES then
Proceed = true
If proceed = true then
...further processing.....
Do you mean
While Ende<>True
-or perhaps-
While Not(Ende)
Andrew

IIUC from the confusing parts, you may want to display command button
as visible as long as "proceed=true"?
Dim proceed as boolean
While proceed=true
button1.visible = true
End While

here is button1 is your command button and don't forget to hide it by
default till proceed value returns the boolean as true.

Hope this helps.
Seems your code is VB6 one, did you mean that :(.NET version)
you must use button click event to fire a work without assining
boolean value to a button.
Here is a sample which you may need with named button1 (change
command1 name to button1)
'Put this in declaration area before button1_click event
Dim proceed As Boolean
Private Sub button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
proceed = True
While proceed = True
' ' 'do the work
End While

In this strategy you may want to set "proceed" 's initial value as
"false" , because you make it "true" when you click button as follows:

'Put this before button1_click event
Dim proceed as Boolean = false

Hope this helps.
End Sub

Jan 4 '08 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Bernd Smits | last post by:
Hi, I would like to delete a record (with commandbutton) of a table associated to a combobox, when I select a certain value in the combobox (the value I select is associated with the record that I...
2
by: Jason | last post by:
I have an ASP.NET page that needs to use values set in session variables to perform certain functions. I have code in the Page_Load event that makes sure the session has not been restarted: If...
2
by: Gopal Krish | last post by:
Folks, My ASPX page uses a custom user control. What happens here is that when a runtime error occurs in the ASPX page, the error is caught in the error handler and then strangely, the execution...
6
by: Sakharam Phapale | last post by:
Hi All, How to move the CommandButton control using mouse from one position to other? Is it possible using Drag, Drop events or I have to write my own code for that? I have set the...
0
by: kar3n.chandra | last post by:
Hey, i have a c# program opening and creating powerpoint slides and i created a commandbutton on the slide. the problem i'm having is changing the caption of the button. i've placed the code...
4
by: Jamey Shuemaker | last post by:
Howdy, Saw a couple threads from the past few years on this topic, but didn't really find any solutions. Here's one I found:...
1
by: HelloWorldHelloWorldHello | last post by:
Can Anyone Tell Me How to direct KeyAscii with using CommandButton Only.?
2
by: kaokao1 | last post by:
(Please Excuse my poor English). Hello Friend, Receive a cordial greeting. Friend, please see if you could help me with the following thing: I opened a Sheet of Excel, then I inserted a...
0
by: susan | last post by:
Hi, I'm using Accrss 2003. I try to build a GUI using the Webpage-option in Access. Now I want to call a procedure by placing a CommandButton on the webpage. Doing so I find the following in thr...
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:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.