Addressing Variables

G

Guest

I am a newbie to VBA, but not coding. I volunteer at the local food bank.
They use a database to schedule volunteers in to sort the food collected.
User wants me to forcast how many vols will be here at a given time on a
given day. DB record contains start time, end time and number scheduled. I
have successfully programmed that concept and placed it in a 24 by 60 array.
Now I must display it. Main form is frmMain, command button is cmdProjSched
which calls expression cmdProjSched_Click. Within sub procedure I have used
Current.Session, SQL code and ADO to call records, fill the array and get
ready to print. Cannot seem to get output form frmSchedVol to address the
array. Using output form properties, I think I need to populate the Record
Source with the address of the array, but I don't know how to do that. Any
help?
 
T

TC

You don't need arrays to display table data in Access. So it seems to
me that you are probably starting from the wrong baseline. It's like,
"I've filled my car's gas tank with water. Now how do I start it?" :)

Lets' go back to the start. You say you have a table containing:
- start time
- end time
- number scheduled
From that data, you want to know "how many vols will be here at a given
time on a given day".

(1) What is a "vol"? How does it relate to "number scheduled"?

(2) Are the start time & end time values really just times? Or do they
include *dates* as well? If not, how can you relate the information to
any particular day?

HTH,
TC (MVP Access)
http://tc2.atspace.com
 
G

Guest

Obviously, I was not clear enough. The file contains the date, arrival time,
departure time and number of volunteers scheduled for that time period. I
have managed to collect all the data in a 25 X 60 array, (date plus 24
half-hour time periods showing the total number of volunteers scheduled for a
given time period for the next sixty dates starting from today). I want to
display this for the user so they do not accidently schedule too many
volunteers for a given time period, e.g. more than the staff can supervise.
The question is, can I display the array on a form or must I write it to a
table, display the table and delete the table when they are through. They
take new schedules for volunteers throughout the day and this could be called
up 10 to 15 times a day. Thanks for your efforts.
 
G

Guest

Could not use list box or grid control for same reasons as array, e.g.
addressing. Finally took TC's suggestion and wrote array to a table and am
now attempting to show that table as a datasheet on a form. The code

strDocName = "frmSchedVol"
DoCmd.OpenForm strDocName, adPreview

refuses to launch the form which has a record source of the table I created
in the click event procedure. I can open the table directly and all the data
is there, but cannot seem to launch from within the click event for the
command button. Can anyone help, please?
 

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