manal 27 Junior Poster

hi
didnt understand what is ur problem
how to increment?

ok just double click on the Add Item button then in it write the code that must happen if it pressed

like
item no=item no+1
and then display it in the text box u want
and show the message of entering the next book

i hope this help if u have more question just post them

manal 27 Junior Poster

hi TurboFreak
you have two problems
First :-

Gr1 = InputBox("Please enter " & Student & "'s first test score:", "First Test Score")
while you have defined Gr1 as single if user entered any thing rather than numbers the program crash.....so first thing define Gr1 as string

Second
If Not IsNumeric(Gr1) Or 100 >= Gr1 >= 0 Then

if you defined Gr1 as string this if statment will not work
coz Gr1 is string and cant compare it with numbers so compare it just when its number

so the do loop will be like this

Do
Gr1 = InputBox("Please enter " & Student & "'s first test score:", "First Test Score")

If Not IsNumeric(Gr1) Then
MessageBox.Show("Please enter a valid first test score.")
Else
s1 = CSng(Gr1)
If s1 > 100 Or s1 < 0 Then

MessageBox.Show("Please enter a valid first test score.")

End If
End If

Loop Until IsNumeric(Gr1) And s1 >= 0 and s1 <= 100


note : the avrage will be
Average = (s1 + s2 + s3) / 3
where s1 and s2 and s3 are single

i hope this will solve the problem

manal 27 Junior Poster

hi
from the properties of that textbox....make the MaxLength=10
and u need to do some function in order to validate data that has been entered

manal 27 Junior Poster

hi
try this
Dim kubus As New Form2
and this for all ur form
i hope it help

manal 27 Junior Poster

hi
here is the link of subject of how to print form i didn't try it my self but hope it help u
http://www.daniweb.com/techtalkforums/thread8575.html

manal 27 Junior Poster

hi...
try this website
http://www.functionx.com/vbnet/oledb/Lesson01.htm
i hope it help u

manal 27 Junior Poster

hi....
i tryed ur code after added these 2 lines and it works
applicationWord = CreateObject("Word.Application")
documentWord = applicationWord.Documents.Add

u need to check the dataset if it has value...

manal 27 Junior Poster

hi every one
i wrote code for printig using vb.net 2003..i have problem with
print preview that when it show up and i just close it ..it start printing...
i hope any one can help me..
thanx

manal 27 Junior Poster

sure ...

manal 27 Junior Poster

it didnot work :sad:


Dim items1 As String
Dim r As Integer = 0
Dim c As Integer = 1
While r < DsStaffName1.StaffAccount.Rows.Count
items1 = DsStaffName1.StaffAccount.Rows(r).Item(c)
CheckedListBox2.Items.Add(items1)
r = r + 1
End While

i think the error in this statement (DsStaffName1.StaffAccount.Rows.Count) ... but i do not know where or why!!!
bcz i add a label to show me the count .. but it always (0)
:?:

it works with me....just check if the column 1 exist in ur tabel....
and did u clear dataset and fill dataadapter???

manal 27 Junior Poster

hi again..just one column ..so no need to collect it to one string i thought u want to show row of many columns..
any way..ofcourse u need to give c value at start...
Dim c As Integer=number_of_column_u_want
While r < DsStaffName.StaffAccount.Rows.Count
items1 = DsStaffName.StaffAccount.Rows(r).Item(c)

CheckedListBox2.Items.Add(items1)
r = r + 1

end while..
i think this must work i hope...

manal 27 Junior Poster

see.... when u have dataset it represent the table in database that u have
so if u have r rows and c column ...u will go through one row at time and collect all the columns in it..
item=""
with 2 whiles one for rows and inner one for columns collect each cell and add it to item like this.....
item=item & dataset.TabelName.Rows(r).item(c)
CheckedListBox1.Items.Add(item)

hope it is helpful

manal 27 Junior Poster

sure any time

manal 27 Junior Poster

hi ....
i did this ..first u need dataset and data adapter...
then u will go through each row in dataset and collect the items in one string...then use
CheckedListBox1.Items.Add(the string u collect)

ok i hope this will help

manal 27 Junior Poster

hi every one .
does any one know how to insert checkbox in datagrid so user can select row and how to know which rows selected

manal 27 Junior Poster

Salam...
I need to get value that has been selected from combobox ..
the values in combobox is taken from column's contents of one of tabel in database..so once i write if x=combobox.selectedvalue..i got error that i Additional information: Operator is not valid for type 'DataRowView' and string

manal 27 Junior Poster

Thank u..it was helpful

manal 27 Junior Poster

Slam evey one...
i have question i hope i find its answer here.....
i want to read date from datatimepicker that user select then store value in database i know how to connect to database and how to get value from datetimpicker but need to know how to store it

Thanx...

manal 27 Junior Poster

Label2.Text = Int(Rnd() * 6) + 1
Label3.Text = Int(Rnd() * 6) + 1

i think u want to display die 1 an die2 in label2 and label3...but u call the Rnd again......which give different value each time

manal 27 Junior Poster

No......it dose have value
i want to write program that read the names of student of specific section from excel file and display it in textbox

actually each cell has name of student

manal 27 Junior Poster

varname=xlsheet.Cells(1, 1).value?

thanks....
i don't have now run time error
but i tried to display result on textbox i always have empty textbox???

manal 27 Junior Poster

hi
I want to know how to read from excel file
i know how to open it but how to store cell's value from excel to the variable
i wrote
varname=xlsheet.Cells(1, 1)

and i got run timeerror
"cast from range to "string not supported