|
adnanbilwani wrote: i have a GL table in which code,desc,debit,credit field
i have a customer talbe in which opening balance come
i want to caclulate opening balance in crystal report
where user prompt for date
So write a parameterized query into the database to return the opening balance from whatever date is passed in. You can then use the result in your CR report.
adnanbilwani wrote: also i need a general ledger database in microsoft acess
There is no chance that anyone is going to just GIVE you this. You have to write it yourself.
|
|
|
|
|
Hi all
- I am trying to disable all Textbox in GroupBox
- I am trying to filter the controls in a form so I can get only Textbox
The code I managed to do is this (which is working fine)
For Each _TextBox As Object In Me.GroupBox1.Controls
If TypeOf (_TextBox) Is TextBox Then
_TextBox.Enabled = False
End If
Next
I have 3 questions.
Q1: After I type the dot in "_Textbox." I see the object property is shown up in the intellisense because I had declared the variable _Textbox as Object , but when I am trying to declare it as Textbox it gives error message
For Each _TextBox As TextBox In Me.GroupBox1.Controls
{"Unable to cast object of type 'System.Windows.Forms.Label' to type 'System.Windows.Forms.TextBox'."} PS: I have Label in the groupbox
Q2: I am able to get only the textbox by doing (For Each + TypeOf), cannot I do it in single line or command?
Q3: In VFP there is a method belong to the form called SetAll , it works like this, form1.SetAll("Textbox","Enabled","False") .
Is there similar method in vb?
TIA
Like car accidents, most hardware problems are due to driver error.
Samir R. Ibrahim
|
|
|
|
|
Try changing:
For Each _TextBox As Object In Me.GroupBox1.Controls
If TypeOf (_TextBox) Is TextBox Then
_TextBox.Enabled = False
End If
Next
to:
For Each _TextBox As Control In Me.GroupBox1.Controls
If TypeOf (_TextBox) Is TextBox Then
_TextBox.Enabled = False
End If
Next
you might even be able to get away with:
For Each _TextBox As Control In Me.GroupBox1.Controls
If _TextBox Is TextBox Then
_TextBox.Enabled = False
End If
Next
Hope this helps.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Henry Minute wrote: If _TextBox Is TextBox Then
The above does not works.
I change Object to Control, It is better to work with it like this.
Thanks for the Idea.
Like car accidents, most hardware problems are due to driver error.
Samir R. Ibrahim
|
|
|
|
|
I would use
For Each _Ctrl As Control In Me.GroupBox1.Controls<br />
If TypeOf (_Ctrl ) Is TextBox Then<br />
(Textbox)_Ctrl.Enabled = False<br />
End If<br />
Next
Q2 yes thats correct you need to test each control in the groupbox
Q3 - nope, no such animal.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Mycroft Holmes wrote: Q2 yes thats correct you need to test each control in the groupbox
Thank you for the confirmation.
Mycroft Holmes wrote: Q3 - nope, no such animal.
Like car accidents, most hardware problems are due to driver error.
Samir R. Ibrahim
|
|
|
|
|
I Guess I had Found what I was searching for.
For Each _Ctrl As Control In Me.GroupBox1.Controls.OfType(Of TextBox)()
No Need for TypeOf in the second line.
Thanks for all who replied to my post.
Like car accidents, most hardware problems are due to driver error.
Samir R. Ibrahim
|
|
|
|
|
Cute - nice piece of code!
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Halo,
Iam very new to vbnet so i need help to solve the following,
i have a database file with students exams information whereby a student
participated in 8 subjects.
now i want to get the count of the students who got A, A-, B+ etc in
evey subject and in every class i. e.in form1 form2 e.t.c where subject
marks <>n/a (not applicable)
I also need to count the number of students who participated in every subject where
subject_mark <> n/a-
and also get the average in every subject.
I also want to show and print this information in crystal reports or ms-reports in
vbnet 2005 pro.
i would be very happy if i get anycode sent by email.
Thank you.
|
|
|
|
|
This sounds suspiciously like a class assignment.
You must do your own work young man.
Firstly no-one will ever write your code for you, you must write your own, and people will help you out.
Secondly, you are asking for a lot, don't. Ask for a little each time.
Also, have you tried Here[^] I find it helpful.
------------------------------------
"Children today are tyrants. They contradict their parents, gobble their food and tyrannize their teachers. I despair for the future."
Socrates 400BC
|
|
|
|
|
Jimnahsh wrote: i would be very happy if i get anycode sent by email.
I bet you would, however this is generally called cheating where I come from. Do your own homework, or at least attempt it and come back with specific problems.
Bob
Ashfield Consultants Ltd
Proud to be a 2009 Code Project MVP
|
|
|
|
|
Thank you for being concerned about the complex question-
but surely i am not a student but my project is real, i had been
programming with vb6 but wanted to get the depth of the net
this is an example where i tried to get the results in v6 but found that if i use aloop the code could be to long:
Set conn = New ADODB.Connection
conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:/Program files/Ease_Mark2010/ExamsFile.Mdb;Persist Security Info=False"
Set rs = New ADODB.Recordset
Dim strSQL As String
strSQL= "SELECT Count(*) AS [Mean Grade]From Results WHERE (((Results.[Mean Grade])='B-'And (Form_ID)='2")
from this code i was getting the correct rusults for the selected class.
The question is, i have 12 arugements for one class (A,A-,B+, etc)
and also 12 subjects to loop through.
therefore i wanted a clue to get used with vbnet 2005.
thank you.
|
|
|
|
|
Well, without knowing the database structure its difficult to advise you, but generally I would do this sort of processing in the database, but I wouldn't be using access.
Bob
Ashfield Consultants Ltd
Proud to be a 2009 Code Project MVP
|
|
|
|
|
Thank you Ashfield,
I am using ms Access 2003 mdb, and my database file
has only one Table, every student has a single Record with Stud_name,Form_ID and
Grades for eight subjects- Maths, English,Kiswahili,Physics, Biology,Chemistry,Agriculture,
CRE,
Actually i wanted to get the (select Count(*)data to appear in Report as follows-
Subjects A A- B+ B B- C+ C C- D+ D D- E
English 2 1 0 2 1 0 3 4 5 0 10 23
Maths 3 2 3 3 3 1 2 1 0 2 1 0
Physics
Biology
further more, if i cant get this type of Results from Access SQL statement,
How can i do it from the Crystal Reports formulas?
hope i have explained my situation
|
|
|
|
|
You may be able to get it from an access, you need a pivot query - I don't have access installed to try it.
Bob
Ashfield Consultants Ltd
Proud to be a 2009 Code Project MVP
|
|
|
|
|
Hi,
How can I have the date from a monthcalendar when I do a drop.
Basicly I do a drop from a label on a picturebox or on a monthcalendar. From the picturebox I have all the info I need, but from the calendar I can't find that info. In the Question[^] on this forum There was no anwser. (It was not me who asked). In google I can't find nothing relevant.
Jan
|
|
|
|
|
Here 1[^] Here 2[^] or Here 3[^]
Set the picker so that on change or selection it assigns a variable the date.
You can use it how you like then.
------------------------------------
"Children today are tyrants. They contradict their parents, gobble their food and tyrannize their teachers. I despair for the future."
Socrates 400BC
|
|
|
|
|
hello,
i am stuck. i have one web application. i want to pass contract number from my web page and give a link to open my windows form with contract number and search all the details for that contract number and populate it in the forms.
so basically i want to pass the parameter from web page to my windows form to populate all the related fields.
hemaxi
|
|
|
|
|
IS the web form running inside your app ? If not., you're creating a link to the exe and assuming it's in a known location ? You can pass parameters to an exe on the command line.
Christian Graus
Driven to the arms of OSX by Vista.
"I am new to programming world. I have been learning c# for about past four weeks. I am quite acquainted with the fundamentals of c#. Now I have to work on a project which converts given flat files to XML using the XML serialization method" - SK64 ( but the forums have stuff like this posted every day )
|
|
|
|
|
No. Web form is not running in my windows application. both are seperate applications but now we want to merge it. so we decided, instead of writing code again , we call windows application from webpage and pass the parameter.
my question here is how to fetch that parameter in windows main form.
ex. if i am passing parameter called "ID" with .exe. when windows application is loading that time i need to know "ID" so that i can write code in FORM_Load event to populate other fields from the table for that "ID".
Pls. reply asap.
|
|
|
|
|
|
Excellent..but Where to write...i've main form in solution. and i dont know how the asp.net team is going to call my windows application. is there any other way.
Thanks for ur help.
Hemrk.
|
|
|
|
|
Nope. And you can make the call to get the command line args anywhere you need to in your code.
Before you start writing it though, you better sit down with the ASP.NET guys and come to an agreement on the format of the arguments you're going to use.
Also, you might also want to discuss with them the security problems you're going to run into running an external .EXE from inside the web-browser. This is normally not allowed unless you've made changes to IE's security policies.
|
|
|
|
|
Thanks Dave.
Its working fine. yes..i was thinking to meet asp team and find out how they are going to call my exe. actually we are working on the same project so there is not security issues as its for our internal office users..so doesnt have to worry about security ..but i dont know whether they are going to pass the parameter commandline or not.
anyways do u have any idea how to pass commandline arguments with calling exe from asp .net
?let me know so i can tell them to use that way.
Thanks again
Hemrk.
|
|
|
|
|
hemrk wrote: so doesnt have to worry about security
Uhhh, the security issue isn't going to be something that you setup. It's going to be something that you have to relax to get it to work. The browser defaults will not let you do this.
|
|
|
|