1,105,344 Community Members

Command Button question

Member Avatar
jemartalaban_1
Light Poster
49 posts since Feb 2013
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

hi, im using vb6 and i dont know how to work on a commandbutton that will trigger to another form. For example, i have a commandbutton in form1 and when i click it, there will be an effect in form2. Example, form1 1+1 and the answer will go to form2. Please Help.

Also in our database, we declare this code so that we can delete the entire data stored to our datagrid and database, we are using ADODC and Data to have access to the ms access. But if there are many data to be erased and error appear. "Key Column information is insufficient or incorrect. Too many rows were affected by update".

Lastly, from database how can i filter the data, based on we wanted. Example, there are Mondays to Saturdays record of payment of the students and i want to compute for all payment of student in the day of wednesday? help me guys please.

Please help. Thanks

Member Avatar
rishif2
Posting Whiz in Training
284 posts since Dec 2012
Reputation Points: 57 [?]
Q&As Helped to Solve: 58 [?]
Skill Endorsements: 4 [?]
 
1
 

first of all please dont ask a lot questions in one post
i think there should be a seperate post for each question
thats why i am gonna tell you right direction for the first question which is regarding to command button

try this on click event of comand button

form2.text1.text=text1.text

here form2 is the target form

hope this helps you

Member Avatar
masterfact18
Light Poster
43 posts since Jan 2011
Reputation Points: 0 [?]
Q&As Helped to Solve: 1 [?]
Skill Endorsements: 0 [?]
 
1
 

for the last question...

i think its better if you will have listbox for the days or create a calendar that will identify which of the date will be computed...and of course after you create a lecords that is needed..
hope this helps you/

Member Avatar
Nutster
Junior Poster
146 posts since Oct 2006
Reputation Points: 52 [?]
Q&As Helped to Solve: 23 [?]
Skill Endorsements: 3 [?]
 
1
 

Using Another Form

On Form1, in the command button Click handler, do the work you want to do and store the value in a variable, say intResult. Then, at the end of the handler, put:

Form2.lblResult.Caption = intResult
Form2.Show

The first line actually sets the value that will be displayed on Form2. The second line makes the form visible, and if it was already visible, bring the form to the front. Keep in mind you have to close both forms in order to shut down the program.

Totalling Daily Payments

To get the total of daily payments from a table of individual payments, use an aggregate function.

SELECT Payment_Date, SUM(Amount_Paid) AS Total_Payment
FROM Student_Payments
WHERE Payment_Date BETWEEN [Start_Date] AND [End_Date]
GROUP BY Payment_Date
ORDER BY Payment_Date

You specify the starting and ending dates, as parameters to a query (as written), or by hard coding the dates when you write the query. If the starting date and ending date are the same, you could replace the BETWEEN condition with an equality test.

Other Stuff

I do not know how to handle your database datagrid issue.

It is best to ask one question per posting so that the people who are answering the question can deal with a smaller and more direct component and that people who are searching for an answer do not have to get though other things irrelevant to their question to get their answers.

Member Avatar
AndreRet
Industrious Poster
4,492 posts since Jan 2008
Reputation Points: 362 [?]
Q&As Helped to Solve: 499 [?]
Skill Endorsements: 24 [?]
 
0
 

Your first question was answered. Please open seperate threads for the other 2 questions.

It keeps the question and answers clear for future users. We can not allow multiple questions in one post.

All other users, please answer OP's questions on his new posts and not here.

Thanx.

You
This article has been dead for over three months: Start a new discussion instead
Post:
Start New Discussion
Tags Related to this Article