aktharshaik 16 Posting Whiz

Corrected Code

Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
    If KeyCode = vbKeyC Then
        If Shift = 2 Then
             Clipboard.Clear
             Clipboard.SetText grd.Clip
        End If
    End If
End Sub

PS: For this to work set the KeyPreview Property of the your FORM to "True"

Regards
Shaik Akthar

debasisdas commented: agree, welcome back. +13
aktharshaik 16 Posting Whiz

Hi,
It is better to start a new thread.
Anyhow here is some solution i can get for u.

Open VB IDE.

1. Insert your ADODC Control in your form.
2. Insert the Command Button.
3. Open the Code Window for Command_Click() and Use this code to set the ADODC Control Properties

Adodc.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & App.Path & "\test.accdb;Persist Security Info=False"
    Adodc.CommandType = adCmdText
    Adodc.RecordSource = "SELECT * FROM USERS"

Rest you make out and get back if any problem.

Regards
Shaik Akthar

marcmanlin2 commented: Thanks +0
aktharshaik 16 Posting Whiz

Hi!!!

Use the following syntax for the SQL Query

SELECT * from customer where customercode = ?

? will display the parameter in the parameter tab

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

UCASE Converts the given string to uppercase.


Ex
Dim x as string
x = "America"
text1.text = UCase(x)

here text1 will display the word in variable x but in upper case "AMERICA"

Regards
Shaik Akthar

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

Try this code

Dim Fso As New FileSystemObject
Dim Fl As TextStream
Dim fName as String

fName = App.Path & "\" & "MyFile.txt"

If Dir(fName) <> "" Then
 If MsgBox("File Exists.OverWrite?",vbYesNo,"FILE EXISTS")=vbYes Then
      Set Fl = Fso.CreateTextFile(fName, True)
 Else
      GoTo ExitPoint
  End If
Else
 'Here True/False is to Overwrite/Not if a file already exists
 'by the name given in fName.
 Set Fl = Fso.CreateTextFile(fName, True)
End If

 Fl.Close

ExitPoint:
 Set Fl = Nothing
 Set FSO = Nothing

Regards
Shaik Akthar

aktharshaik 16 Posting Whiz

Check this

dinilkarun commented: Very helpful person. +1