Solved

vbKeyCode

Posted on 2003-10-28
2
599 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
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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…

757 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now