Results 1 to 2 of 2

Thread: VBA Arrays and datasheets

  1. #1

    Thread Starter
    New Member
    Join Date
    Dec 2004
    Posts
    2

    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.

  2. #2
    Junior Member llkhoutx's Avatar
    Join Date
    Jan 2005
    Location
    Houston, TX
    Posts
    19

    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width