VBA Arrays and datasheets
OK,
This is kinda similar to my other thread but the again it is far enough apart that I felt it deserved something else.
Once again here is my issue, I have a form and a subform. The subform I would like to display in datasheet view to allow for fast data entry.
I have thought through the process and was thinking maybe I could use an array. Now I was just wondering how I could pass all of the values for one of these fields into an array. For example, if i make an array with 80 fields, just to take a little confusion out of it, and assign it to the customer purchase id field. If there are 30 purchases in this datasheet view, how could I pass these 30 ids to the array.
Re: VBA Arrays and datasheets
dim ij as byte
dim YourArray(29)
for ij = 0 to 29
if IsNotNull(forms!YourformName!YourSubformName.form(FieldnAME & CSTR(IJ))) then
YourArray(ij)=forms!YourformName!YourSubformName.form(FieldnAME & CSTR(IJ))
else
YourArray(ij)=""
next
The foregoing resumes that your fields are number 0 thru 29, which may not be accrucate, in which event you could use a recordsetclone and calculate the fileld names, If you need help in that regard, please advise.
May the above will get you started.