aktharshaik 16 Posting Whiz

post the code again now,

and which of ur fields are Text and which of them are numeric in the database

and also the error message please.

Regards
Shaik Akthar

aktharshaik 16 Posting Whiz

post the code again now,

and which of ur fields are Text and which of them are numeric in the database

and also the error message please.

Regards
Shaik Akthar

aktharshaik 16 Posting Whiz

U need not select the items to remove them.

Loop thru all the items in the listview with index for tracking the item against the loop variable. compare the values of each item and delete which ever match the criteria. when deletion occurs the indices of the items following the deleted item will change. hence keep track of the last index.

If still problem persists then i will try to help u with some sample code.


Regards
Shaik Akthar

aktharshaik 16 Posting Whiz

check out the syntax. u have added single quotes to the numeric fields also. remove them.

'" + Combo1.Text + "','" + Combo2.Text + "','" + Text1.Text + "','" + Text2.Text + "','" + Text3.Text + "','" + Text4.Text + "','" + Text5.Text + "','" + Text6.Text + "','" + Text7.Text + "'
'must be
'" + Combo1.Text + "','" + Combo2.Text + "'," + Text1.Text + "," + Text2.Text + "," + Text3.Text + "," + Text4.Text + "," + Text5.Text + "," + Text6.Text + "," + Text7.Text + ")"

I am unable to figure out the numeric fields from ur query, but that's the problem.

Put quotes for text fields and remove them for numeric fields.


Regards
Shaik Akthar

aktharshaik 16 Posting Whiz

Try This Code. By the r u using MS-Access as database?
If not then modify the Where Clause with language specific syntax for putting the dates in the query.

%%imp%%
Replace the [SALEDATEFIELD] with the date fieldname in your "SalesTable" table.

Set SALE = Dbase.OpenRecordset("select ProdCode, ProdName, sum(Quantity) as Qty, Price from SalesTable Where [SALEDATEFIELD] between #" & dtpicker1.Value & "# AND #" DTPicker2.Value & "# GROUP BY ProdCode, ProdName, Price ORDER BY PRODCODE, PRODNAME, PRICE")

While Not Sale.EOF
    With grd
        .Rows = .Rows + 1
        .TextMatrix(.Rows - 1, 0) = SALE!ProdCode
        .TextMatrix(.Rows - 1, 1) = SALE!ProdName
        .TextMatrix(.Rows - 1, 2) = SALE!Qty
        .TextMatrix(.Rows - 1, 3) = Format((SALE!Price), "#0.00")
        .TextMatrix(.Rows - 1, 4) = Format((SALE!Price * SALE!Qty), "#0.00")
    End With
    total = total + grd.TextMatrix(grd.Rows - 1, 4)
    Sale.MoveNext
Wend

Regards
Shaik Akthar

aktharshaik 16 Posting Whiz

Go to www.sybase.com
Download 'SQL Anywhere Studio'
You'll need to register yourself, but that's easy.
Then you only install the 'Network database client' (in AdaptiveServer Anywhere for Windows)

may help to load the driver.

Regards
Shaik Akthar

aktharshaik 16 Posting Whiz

Please refer the Last comment and Attachment in the following thread posted by me.
http://www.daniweb.com/forums/thread154332.html

Regards
Shaik Akthar

aktharshaik 16 Posting Whiz

Corrections

rs.Open "Insert Into Deliver (scode, pcode, quantity, unit, amount, pcarrier, pterms, drnumber, date) Values ('" + Combo1.Text + "','" + Combo2.Text + "','" + Text1.Text + "','" + Text2.Text + "','" + Text3.Text + "','" + Text4.Text + "','" + Text5.Text + "','" + Text6.Text + "','" + Text7.Text + "')", cn, adOpenKeyset, adLockPessimistic

must be

cn.Execute "Insert Into Deliver (scode, pcode, quantity, unit, amount, pcarrier, pterms, drnumber, date) Values ('" + Combo1.Text + "','" + Combo2.Text + "','" + Text1.Text + "','" + Text2.Text + "','" + Text3.Text + "','" + Text4.Text + "','" + Text5.Text + "','" + Text6.Text + "','" + Text7.Text + "')"

and

rs1.Open "select * from Product where pcode='" & Combo2.Text & "'", cn, adOpenKeyset, adLockPessimistic

must be

rs1.Open "select * from Product where pcode='" & Combo2.Text & "'", cn, adOpenDynamic, adLockOptimistic

remove the statement

rs.close

Regards
Shaik Akthar

aktharshaik 16 Posting Whiz

Please post some sample code ur using, some sample data of the arrays. 'll try to figure out something.

Regards
Shaik Akthar

aktharshaik 16 Posting Whiz

Dear Taher,

Your entire logic is correct. there is no mistake except for the fieldnames which u r using. they have a space in between. if u need to specify fieldnames which have space then use either of the following ways to denote them.

For field Student Id use
rst.Fields("Student Id")
or
rst![Student Id]

I have modified the project and am uploading it back for ur reference. hope this solves ur problem.

Another suggestion is that try not using the fieldnames with spaces, instead use a underscore to connect if the fieldname is of two words like

u can use "Student_Id" instead of "Student Id"
"Student_Name" instead of "Student Name" and "Roll_No" instead of "Roll No"

Regards
Shaik Akthar

aktharshaik 16 Posting Whiz

plz make ur problem a little more clear.

Regards
Shaik Akthar

aktharshaik 16 Posting Whiz

Check out the following link. it may lead to ur problem solution.


http://www.freevbcode.com/ShowCode.asp?ID=3650


Regards
Shaik Akthar

aktharshaik 16 Posting Whiz

you can't use find method on more than one column. ADO's Recordset.Find method works on one column, and one column only. why do you want to use Find? Although it is appropriate in some situations, using it to locate records is generally very inefficient, in terms of speed and memory. Find works by examining each record in a Recordset for the criteria you give it after you have created the Recordset and retrieved all the data from your database. Retrieving lots of unwanted records, particularly down the wire from a server, when you are really interested in only a handful, or sometimes just one row of data. This creates a lot of unnecessary overhead. Unless you have a very compelling reason for using Find, I'd recommend using an alternative approach, like filtering your Recordset or using SQL, for serious performance gains.

The Recordset.Filter method filters out records that don't match one or more criteria. You can specify multiple conditions in a filter by using 'AND' or 'OR', so using Filter would allow you to check multiple columns. For example, suppose we open a Recordset and execute the following code:

rs.Filter "Country='India' and Place='Delhi'"

The Recordsetrs would then contain only records where the Country and Place fields were India and Delhi, respectively. If no records existed that match these criteria, rs would be empty, with rs.EOF and rs.BOF both true. To remove a filter from a Recordset, set the Filter property to an empty string ("") or the …

aktharshaik 16 Posting Whiz

I have just put a label outside the select case BLOCK to transfer the control outside of the select block once any case is executed. but it is not mandatory. YOU CAN OMIT THE GOTO STATEMENT

Regards
Shaik Akthar

aktharshaik 16 Posting Whiz

tRY THIS

Dim mpaddr1  As String
    Dim intX As Integer
    Dim f As Integer

    f = FreeFile
    mpaddr1 = "No:11/19 , Anna Salai , Chennai-1"

    Open "C:\ADD.TXT" For Append As #f

    For intX = 0 To UBound(Split(mpaddr1, ","))
        Print #f, Tab(1); Split(mpaddr1, ",")(intX); Tab(42); Split(mpaddr1, ",")(intX)
    Next

    Close #f

I think that you might be viewing in the notepad with "Word Wrap" option as TRUE. where if the line is lengthier than the window margin it is automatically wrapped down to next line.

Please check that the following option in the Notepad is FALSE
Format -> Word Wrap

Hope this solves ur problem

Regards
Shaik Akthar

aktharshaik 16 Posting Whiz

Use Select Case

Select Case MSFlexGrid1.ColSel
    Case 0:
         form1.Text1.Text = MSFlexGrid1.TextMatrix(MSFlexGrid1.RowSel, MSFlexGrid1.ColSel)
         goto Label1
    Case 1:
         form1.Text2.Text = MSFlexGrid1.TextMatrix(MSFlexGrid1.RowSel, MSFlexGrid1.ColSel)
         goto Label1
    Case 2:
         form1.Text3.Text = MSFlexGrid1.TextMatrix(MSFlexGrid1.RowSel, MSFlexGrid1.ColSel)
         goto Label1
    Case 3:
         form1.Text4.Text = MSFlexGrid1.TextMatrix(MSFlexGrid1.RowSel, MSFlexGrid1.ColSel)
         goto Label1
End Select

Label1:

Regards
Shaik Akthar

aktharshaik 16 Posting Whiz

Can u attach the three forms?

aktharshaik 16 Posting Whiz

If the remaining cells are the adjacent to each other, you can hardcode the column numbers!

form1.Text1.Text = MSFlexGrid1.TextMatrix(MSFlexGrid1.RowSel, 0) 'For data in Column 0
form1.Text2.Text = MSFlexGrid1.TextMatrix(MSFlexGrid1.RowSel, 1) 'For data in Column 1
form1.Text3.Text = MSFlexGrid1.TextMatrix(MSFlexGrid1.RowSel, 2) 'For data in Column 2
form1.Text4.Text = MSFlexGrid1.TextMatrix(MSFlexGrid1.RowSel, 3) 'For data in Column 3

The row is constant for the row u have selected. only change the columns.

Regards
Shaik Akthar

aktharshaik 16 Posting Whiz

Since in the Branching Statement one and only one condition is executed, u can first finish getting the query. and then apply the Execute Statement.

Dim sql12 As String
If release.Enabled = True And nonosc.Enabled = True Then
        sql12 = "update Passport_Release_Information_N set Ename2='" & taker.Text & "' ,Any_ID1='" & takerid.Text & "' ,E_ID1 = '" & Label7.Caption & "',R_Status= '" & status.Caption & "' WHERE R_ID_N='ASDF'"
Else
    If release.Enabled = True And osc.Enabled = True Then
        sql12 = "update Passport_Release_Information_O set E_ID_3='" & takerid.Text & "' ,E_ID_4 = '" & Label31.Caption & "',R_Status= '" & status.Caption & "' WHERE R_ID_N='ASDF'"
    Else
        sql12 = ""
    End If
End If
If sql12 <> "" then
  CN.Execute sql12
  status.Caption = "RELEASED"
End If

Regards
Shaik Akthar

aktharshaik 16 Posting Whiz

Also have a look at this url

http://reportviewer.biz/knownissues.html

Regards
Shaik Akthar

aktharshaik 16 Posting Whiz

Some clarification points needed regarding ur requirement.

Can u plz tell the version of Crystal Reports which u r using?

What is the Database and its version. Is it MS Access, if yes, which version.

To view the report are u using Crystal Report ActiveX Control or CRViewer?


Regards
Shaik Akthar

aktharshaik 16 Posting Whiz

Sorry. Could not follow your requirement correctly. Can u plz explain more specifically with sample data.

nw... i want to connect every individual field in my database to another corresponding field for example i hv a combo box(empname) on my form and a label for corresponding ID(empid) and in my database the table name is Employee and fields for these two are E_id E_name... im not able to connect the fields individually... i tried connecting with the following code

Regards
Shaik Akthar

aktharshaik 16 Posting Whiz

Try This

Dim db As New ADODB.Connection
Dim rc As New ADODB.Recordset
[B]db.CursorLocation = adUseClient[/B]
db.open"Provider=Microsoft.Jet.OLEDB.4.0;Data Source="& App.path &"\tmgmt.mdb"

Regards
Shaik Akthar

aktharshaik 16 Posting Whiz

U want to resize controls automatically when form resizes.

Have a look at this sample project i have attached here. Observe the tag Property of each control.

Changing the tag property helps in resizing/positioning as per ur requirement.

u can use varWidth, varVertical, fixBottom, fixRight etc.

this code can be found at the following url with some additional information

http://www.codeguru.com/vb/gen/vb_fo...cle.php/c5949/

Regards
Shaik Akthar

aktharshaik 16 Posting Whiz

Do u want to write this code :

a) from within an Excel file in VBA Editor?

OR

b) from within Word file in VBA Editor?

OR

c) from VISUAL BASIC IDE?


Regards
Shaik Akthar

aktharshaik 16 Posting Whiz

enclose the table name in []

like

[hello world]


hope it solves ur problem

Regards
Shaik Akthar

aktharshaik 16 Posting Whiz

The code after the Exit Sub cannot be reached at all. the procedure exits at that point and the code which u have written below the Error Handler Label is never reached. That's why the error.

Private Sub Form_Load()

    On Error GoTo Form_Load_Error

    Set con = New ADODB.Connection
    con.Open "Provider=Microsoft.Jet.Oledb.4.0;Data Source=" & App.Path & "\Office Utilization.mdb"
    Call FillLocation
    Call Filllocation2
    
Form_Load_Done:
    Exit Sub

Form_Load_Error:
    MsgBox "An Error has occured in Procedure Form_Load." & vbCrLf & vbCrLf & Err.Number & " : " & Err.Description
    Resume Form_Load_Done



  Dim i As Integer
  
  ' Get a recordset to use with the report
  Set rs = CreateRecords
  
  ' Populate Comboboxes
  For i = 0 To cboSort.Count - 1
    With cboSort(i)
      .AddItem "(None)"
      .AddItem "locname"
      .AddItem "floorname"
      .AddItem "seatno"
      .AddItem "empname"
      .ListIndex = 0
    End With
  Next

End Sub

Please correct this procedure. It should be like this.

Private Sub Form_Load()

    On Error GoTo Form_Load_Error

    Set con = New ADODB.Connection
    con.Open "Provider=Microsoft.Jet.Oledb.4.0;Data Source=" & App.Path & "\Office Utilization.mdb"
    Call FillLocation
    Call Filllocation2
    
    Dim i As Integer
  
    ' Get a recordset to use with the report
    Set rs = CreateRecords

    ' Populate Comboboxes
    For i = 0 To cboSort.Count - 1
        With cboSort(i)
            .AddItem "(None)"
            .AddItem "locname"
            .AddItem "floorname"
            .AddItem "seatno"
            .AddItem "empname"
            .ListIndex = 0
        End With
    Next

Form_Load_Done:
    Exit Sub

Form_Load_Error:
    MsgBox "An Error has occured in Procedure Form_Load." & vbCrLf & vbCrLf & Err.Number & " : " & Err.Description
    Resume Form_Load_Done

End Sub

Hope this solves ur problem

Regards

aktharshaik 16 Posting Whiz

If u dont have a primary key in ur table u can use a dummy column to retreive the data.

By this u can have another column which will be the SlNo column. now u can update the row based on the serial number.

1. Create a Module in the MS ACCESS Database only and put the following code and save it.

Option Explicit
Dim mlngCounter As Long

Function ResetCounter()
  mlngCounter = 0
End Function

Function NxtCnt(pvar As Variant) As Long
  mlngCounter = mlngCounter + 1
  NxtCnt = mlngCounter
End Function

In VB use the following query to retreive the data from the table.

" SELECT NAME, AGE, ResetCounter() AS DUMMY1, NxtCnt(NAME) AS SLNO
FROM DATAINFO "

u will get two columns along with the name and age columns, i.e. the DUMMY1 column which is empty and SLNO column as 1,2,3,4... in serial.


Don't know whether this may help u or not but this was the most i could think of.

Regards
Shaik Akthar

aktharshaik 16 Posting Whiz
Private Sub cmdEdit_Click()
chec:

 Set rst = New ADODB.Recordset

 With rst
  .ActiveConnection = Con
  .CursorLocation = adUseClient
  .CursorType = adOpenDynamic
  .LockType = adLockOptimistic
  .Open "datainfo"
 End With

'Before applying the values u can move to the next record first.
'But this statement can be applicable when the two records are very next
'to each other only or if they are opened with a condition like " WHERE NAME = 'xyz' "

 rst.MoveNext
 With rst
  .Fields!Date = StrConv(fldDateGetter, vbProperCase)
  .Fields!firstname = StrConv(fldFname, vbProperCase)
  .Fields!middlename = StrConv(fldMname, vbProperCase)
  .Fields!lastname = StrConv(fldLname, vbProperCase)
  .Fields!age = StrConv(fldAge, vbProperCase)
  .Fields!sex = StrConv(fldSex, vbProperCase)
  .Fields!telno = StrConv(fldTelNo, vbProperCase)
  .Fields!address = StrConv(fldAddress, vbProperCase)
  .Fields!occupation = StrConv(fldOccupation, vbProperCase)
  .Fields!diagnosis = StrConv(fldDiagnosis, vbProperCase)
  .Fields!treatment = StrConv(fldTreatment, vbProperCase)
  .Fields!remarks = StrConv(fldRemarks, vbProperCase)
  .Fields!timenow = StrConv(fldTimeGetter, vbProperCase)
  .Fields!datetester = StrConv(fldDateTester, vbProperCase)
  .Update
 End With

 Call dload2
End Sub

I do not think that this is the possible solution. A Primary Key needs yet to be defined if u want to identify a row uniquely in your table.

Regards
Shaik Akthar

aktharshaik 16 Posting Whiz

Hi!
Just change the variable name please, i typed it wrong as crApp instead of crxApp.

Dim crxApp As New CRAXDDRT.Application
Dim crxReport As New CRAXDDRT.Application

Set crxReport = [B]crxApp[/B].OpenReport(App.Path & "\studentregister1.rpt")
( here i got error message " Variable not defined ) ( crapp )

CRViewer.EnableNavigationControls = True
CRViewer.DisplayGroupTree = False
CRViewer.EnableExportButton = True
CRViewer.EnableSearchControl = True
CRViewer.ReportSource = crxReport
CRViewer.ViewReport

Regards
Shaik Akthar

aktharshaik 16 Posting Whiz

The answer to why is it that the first one is also affected is, you get what u asked for.

u might have given in the query like
UPDATE table SET NAME = 'Michel Jackson' WHERE NAME = 'Mark Jackson'

here not only for 2 records, if u have 10 records in the same fashion, all the ten will be affected because the query given does not specify any scope and hence all the records in the table as checked for the condition of NAME = 'Mark Jackson' and change them to 'Michel Jackson'

If without primary key u cannot specify any filter. The most u can do, i think is, Open all the records with condition into a Recordset.
Move to the 2nd Record, if it exists, and Update the fields.

And why is it that u dont want to add a primary key?

Regards
Shaik Akthar

aktharshaik 16 Posting Whiz

Use the Package and Deployment wizard to create the Setup Package from the source system where u have developed this project.
This addin is a part of Microsoft Visual Basic.

1. Open ur project
2. Select Add-Ins -> Add-In Manager... option
3. Select the Package & Deployment Wizard
4. Put a check for Loaded/Unloaded and Load on Startup check boxes.
5. Click Ok.

Now u can find the Package & Deployment Wizard menu option in the Add-Ins menu. Click it and follow the instructions. This wizard will automatically identify all the required object, components and dlls for the project. except for user created files like ur database files, icon files etc. which if u want can manually add them in, i beleive 4/5 step of the wizard

Once the setup package folder is created, copy it to CD or pendrive and perform the setup process in the target computer. Now u can run the app on the newly installed computer


Hope this helps u. Try it and if any problems get back to us.

Regards
Shaik Akthar

aktharshaik 16 Posting Whiz

post the code where u r trying to create the table, i will suggest the changes where to check for table existency.

Since there are several logics in which we can check for if table exist. if sample code is given, then the soln can be provided in the way u r using the db. remaining types can be shown by us as alternate methods.

Regards
Shaik Akthar

aktharshaik 16 Posting Whiz

The reason for marking the threads as solved is that other users having a similar problem can search for the solution first in the solved threads instead of keeping on posting similar threads which are actually already solved.

It is not for just adding a Solved Thread to my Credit.

Regards
Shaik Akthar

aktharshaik 16 Posting Whiz

Another suggestion is when putting the controls on the form, change their name as per their functionality. like the command buttons can be named cmdSave, cmdCancel, cmdClose, cmdReport... and not Command1, Command2 ...
txtCode, txtName instead of Text1, Text2...
cmbFloor, cmbLocation instead of Combo1, Combo2...

It is not mandatory but only a convention which will help you to arrange the code more systematically.

Use sufficient Tab spacing when writing iteration/conditional statements i.e For...Next, While...Wend, If...Else...End If

Also make a habit of adding error handling code to every procedure to handle any errors that may rose during runtime.

U can follow like the one i have given in the sample project.

I am sorry if i have replied anything out of ur way.


Regards
Shaik Akthar

aktharshaik 16 Posting Whiz

when u want only to read the data use in readonly mode. if u want to manipulate the data then it should be opened in dynamic mode.

try to get some documentation on ADODB usage of Connection, Command, Recordset and Parameter

Regards
Shaik Akthar

aktharshaik 16 Posting Whiz

open the recordset as adOpenDynamic, adLockOptimistic

adOpenKeyset, adLockReadOnly opens the recordset in readonly mode and prevents any changes to the data.


Mark the solved threads as solved if they are solved.


Regards
Shaik Akthar

aktharshaik 16 Posting Whiz

CRViewer can also be used, but the coding will be slightly different

Add the Crystal App references and CrViewer component in References and Components respectively.

'Declare these variable globally in the form module
Dim crxApp As New CRAXDDRT.Application
Dim crxReport As New CRAXDDRT.Report
'-------------------------------------------------------------------------------------

Private Sub cmdShowReport_Click()

 'Set the report object
 Set crxReport = crApp.OpenReport (App.path & "\studentregister.rpt")

 'Enables the Viewer's Navigation Controls
 CRViewer.EnableNavigationControls = True

 'Disable Group Tree
 CRViewer.DisplayGroupTree = False

 'Enable export button
 CRViewer.EnableExportButton = True

 'Disables the CRViewer's Search control
 CRViewer.EnableSearchControl = True

 'Set the report source
 CRViewer.ReportSource = crxReport

 'View the report
 CRViewer.ViewReport

End Sub

Hope this helps u.

Regards
Shaik Akthar

aktharshaik 16 Posting Whiz

use crystal report activex control not CRViewer.

Regards
Shaik Akthar

aktharshaik 16 Posting Whiz

plz post the sample code u r using. will suggest u the solution. i almost have most of the reports in my projects using dot matrix printer only. many ask for it since it is economical to use it. everything can be controlled.

Regards
Shaik Akthar

aktharshaik 16 Posting Whiz

Hi! Smile4Ever,

Exactly as Jx_Man said, elaborate your request dear. can't figure out ur requirement. what tabs? Any sample code u got, tried anything yet?

Never tried = Never Know
So, Please do something before post your thread.

A nice thing to ponder upon.

Regards
Shaik Akthar

aktharshaik 16 Posting Whiz

post some sample code. also could not figure out the requirement exactly as what u want. ur sample code and/or elaboration of ur request will help us to provide the solution.

Regards
Shaik Akthar

aktharshaik 16 Posting Whiz

post the sample code u tried. r u using FileSystemObject or something else we cant guess. ur sample code will help us to provide the solution.

Regards
Shaik Akthar

aktharshaik 16 Posting Whiz
aktharshaik 16 Posting Whiz

check this url. i dont know whether it may help u or not.

http://activexperts.com/activmonitor/windowsmanagement/adminscripts/filesfolders/files/#DeleteAllFilesInFolder.htm

Regards
Shaik Akthar

aktharshaik 16 Posting Whiz

If crystal report is installed, then u can find the Crystal Report Viewer OCX control in VB IDE in the components. Add the crystal report control to your form and configure it to show the required report.

'use whatever is the path of your report
'i have assumes that the rpt file is
'in the application path itself
CrystalReport1.ReportFileName = App.Path & "\studentregister.rpt"
CrystalReport1.Action = 1

Many other properties are also available for the control like to enable print button, to export the report, navigation of pages etc.

Hope this solves ur problem


Regards
Shaik Akthar

aktharshaik 16 Posting Whiz

if u r viewing in notepad, then it is the menu option 'Word Wrap'. when this is on then the text in one line if it exceeds the viewable area of the window it is automatically wrapped. to view without wrapping, just remove the check mark to the 'Word Wrap' menu option.

Format --> Word Wrap


Hope this solves ur problem

Regards
Shaik Akthar

aktharshaik 16 Posting Whiz

plz post the sample code. or upload the project in ZIP format.


Regards
Shaik Akthar

aktharshaik 16 Posting Whiz

'Posi ' variable is used to track as when to move to the next line to print the body or arms or legs of the hangman.

when 'Posi' is 2 (i.e) when 2nd wrong guess is made, the '|' character must go to next line. hence 'Posi' is checked and if it is 2 a new line (vbCrLf) is appended.

Similarly when 'Posi' is 3 again we have to move to the next line to start the hands.
and when 'Posi' is 6 we have to move to the next line to start the legs.

Finally when 'Posi' is 8 (i.e) the hangmans last leg is to be displayed, then will be the end of the guesses because man hanging is complete with the last leg.

This is the point where the user is failed to guess the correct answer.

CheckChar function is used to check if the character typed in the guess box is present in the string pertaining to the 'intQuestionNumber'th value in the array. if not the guess is wrong. hence clear the Guess TextBox and go for the next try. If all tries are over i.e. 'Posi' is reached 8 as said above the game is lost. if before the 'Posi' reaches 8 the string the Question label with '_' matches the 'intQuestionNumber'th value in the array, the game is won.

Also u can count the wins and losses also.

Take 2 global integer variables and make then …

Lil' Tripsturr commented: thanx a lot !!! +1
aktharshaik 16 Posting Whiz

u can create a variable and increment it at every line display.