Saving a number to a variable

G

Gerald

Hello I am new to the module side of access and need some help:

I have three series of eight random numbers that the user will be able to
check which set they want and I need to know two things:
1) how do a properly construct a on click event
2) and how do I move the values of these eight numbers to a permanent
variable set to use in some subsequent work (i.e. add to a table at a point
farther into the project.)

I am simply wanting to move the values to from the uncontrolled random set
to a storage variable that will allow me to assign to a more permanent
location at a future point.

Thanks ahead of time
 
K

Klatuu

There are a number of ways to accomplish this.
The easiest is to create Public variables. You do that by Dimming them in a
standard module as Public

Public lngSomeNumber As Long

For example.
 
M

Mr. B

There are a number of ways to accomplish this.
The easiest is to create Public variables. You do that by Dimming them in a
standard module as Public

Public lngSomeNumber As Long

For example.

--
Dave Hargis, Microsoft Access MVP








- Show quoted text -

Hi, Gerald.

As for your series of eight random numbers, I would suggest that you
take a look at creating an Array type variable. You can define as many
elements for the array variable as you need to hold each value in a
series. Then you can retrieve any one or all of the values assigned
to one element anytime you need it.

For more inforamtion about using arrays, take a look int he VBA help
of Access for "Using Arrays".

As for properly constructing an "OnClick" event, this would depend on
what you are wanting to do. An "OnClick" event can be as simple or as
complex as it needs to be to accomplish the desired results. the
event most likely will also need to have some error handeling as well
as the actions, etc. You would need to be much more specific before
anyone could give you a good example of what to do.

As for moving the values from your series to a "permanant varable
set", I would think that if you need to save the selected series, then
you would need a table to store the values until you are ready to do
something else with them.

Hope this helps.

Mr. B
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top