We're a community of 1076K IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,075,721 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

Command Button question

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

5
Contributors
4
Replies
15 Hours
Discussion Span
2 Months Ago
Last Updated
32
Views
jemartalaban_1
Newbie Poster
12 posts since Feb 2013
Reputation Points: 0
Solved Threads: 0
Skill Endorsements: 0

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

rishif2
Junior Poster
153 posts since Dec 2012
Reputation Points: 54
Solved Threads: 31
Skill Endorsements: 3

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/

masterfact18
Light Poster
43 posts since Jan 2011
Reputation Points: 10
Solved Threads: 1
Skill Endorsements: 0

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.

Nutster
Junior Poster
128 posts since Oct 2006
Reputation Points: 62
Solved Threads: 19
Skill Endorsements: 3

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.

AndreRet
Industrious Poster
4,706 posts since Jan 2008
Reputation Points: 391
Solved Threads: 481
Skill Endorsements: 20

Post: Markdown Syntax: Formatting Help
 
You
 
© 2013 DaniWeb® LLC
Page rendered in 0.0714 seconds using 2.68MB