Solved

vbKeyCode

Posted on 2003-10-28
2
621 Views
Last Modified: 2007-12-19
Option Explicit
Private Sub BackRound_KeyDown(KeyCode As Integer, Shift As Integer)
Select Case KeyCode
Case vbKeyLeft
If GUN.Left <= 300 Then
GoTo NextStep
Else
 GUN.Left = GUN.Left - Grid
 End If
Case vbKeyRight
If GUN.Left >= 300 Then
GoTo NextStep
Else
 GUN.Left = GUN.Left + Grid
 End If
End Select
NextStep:
'unwritten
End Sub
-------------------------------------------------------------------------
The GUN doesnt go right when I press right (vbRight) any ideas?
*Note: Grid has been defined as a Public Const of value 330 on a moudle
0
Comment
Question by:kalaka
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 39

Accepted Solution

by:
appari earned 30 total points
ID: 9638391
I THINK ITS BECOZ OF THIS CONDITION

If GUN.Left >= 300 Then
GoTo NextStep
Else


suppose initial value of Gun.Left=400 then it never goes in to else part. check your condition.
or tell what exactly you were trying to do.
0
 

Author Comment

by:kalaka
ID: 9638444
What would you suggest to set boundaries for the GUN to move?
0

Featured Post

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

729 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question