Re: Array of text boxes on form

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Dirk Goldgar (dg_at_NOdataSPAMgnostics.com)
Date: 05/28/04


Date: Thu, 27 May 2004 23:48:52 -0400


"Howard" <anonymous@discussions.microsoft.com> wrote in message
news:13c8b01c44464$5694fec0$a601280a@phx.gbl
> In a previous message, I requested help on inserting many
> records into a table by the click of a button on a form. I
> received the help I needed. I could be creating as many as
> 100 records, setting about a dozen fields in each record.
> There is a lot of repetition. If I could set the fields on
> the form as an array, I could create a loop to create
> these records in far fewer statements. I would need some
> handholding through this to create an array of unbound
> fields in a form. An example of the statements would help
> tremendously. Thanks!

I'm not sure of your details, but it may help to know that you can build
a string index to similarly named control using concatenation of an
index variable, like this:

    Dim i As Integer
    Dim varValue As Variant

    For i = 1 to 12
        varValue = Me.Controls("Textbox" & i).Value
        Debug.Print varValue
    Next i

That will print the values of text boxes named "Textbox1", "Textbox2",
... "Textbox12".

Would you be interested in posting the code you're using now? Maybe we
can suggest ways to simplify it.

-- 
Dirk Goldgar, MS Access MVP
www.datagnostics.com
(please reply to the newsgroup)


Relevant Pages

  • Array of text boxes on form
    ... I requested help on inserting many ... handholding through this to create an array of unbound ...
    (microsoft.public.access.formscoding)
  • Re: Transferring related records from table to table in one transaction: Two cursors? [Mac FMP 9 Adv
    ... I should then begin inserting each row in this virtual two-dimensional ... array into new related rows in Postings. ... After having inserted all rows into the Postings table, I can commit the ... You need to create importing routines that may store total record numbers in fields to confirm the entire transaction has taken place, in case of a crash or interruption during the import, but this also applies to other methodologies. ...
    (comp.databases.filemaker)
  • Re: a rand array
    ... inserting an element into an arbitrary position in an ... > check for equals in array is O ... When an algorithm has a time complexity of O), ... Insertion is O(I think it'll take something like N/4 iterations on ...
    (comp.lang.c)
  • Re: a rand array
    ... check for equals in array is O ... and randand goto label until no equal ... inserting ... >Linear search isn't all that great, but it doesn't matter much in this case. ...
    (comp.lang.c)
  • Re: Anyone can help?
    ... Inserting into arrays requires copying the array elements ... care about pointers to individual instructions getting invalidated ... insertion not to invalidate pointers to individual members, ...
    (comp.lang.c)