Full Version: Running Code From A Command Button
UtterAccess Forums > Microsoft® Access > Access Forms
Newataccess
On a form, I have a command button. On Click, I want to do the following, but I keeping getting an error...(Invalid Outside Procedure)
Private Sub Command188_Click()
Dim X As Integer
Dim A As Integer
For X = 1 To 20
A = Int((80 - 1 + 1) * Rnd + 1 - 1)
Next X

End Sub
Any suggestions as to why I might be betting that Error (Invlaid Outside Procedure)?
Thanks
gary84
That's an unusual error. That code runs for me as-is.
When I get bizarre errors I do things like,
- In the VBA Window made sure all code everywhere is ok, do a Debug > Compile.
- Make sure the right minimum set of References are active.
- Try re-building the database, by Importing all objects into a blan
This is a "lo-fi" version of UA. To view the full version with more information, formatting and images, please click here.