Results 1 to 2 of 2
  1. #1
    Misjel is offline Novice
    Windows 10 Access 2016
    Join Date
    Oct 2019
    Location
    Belgium
    Posts
    9

    Post add an ascending number to the name of a variable

    Hi,



    How can i add an ascending number to a variable-name "
    Prx(Index)".


    rsO!night = rsO!night * PctN * Prx(Index) * !number

    index can be a number from 1 to 100.

    otherwise i have to do this

    if index = 1 then
    rsO!night = rsO!night * PctN * Prx1 * !number
    elseif index = 2 then
    rsO!night = rsO!night * PctN * Prx2 * !number
    .
    .
    .
    elseif index = 100 then
    rsO!night = rsO!night * PctN * Prx100 * !number
    End if

    Tx in advance

    Regards

    Michel

  2. #2
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,397
    depends on what the variable is - a field or a control?

    for a field

    rs("Prx" & index)

    for a control

    me("Prx" & index)

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Variable number of columns on subreport
    By Edwin1970 in forum Reports
    Replies: 8
    Last Post: 01-22-2021, 03:38 AM
  2. Query with variable number of input parameters
    By keith2511 in forum Queries
    Replies: 16
    Last Post: 05-18-2018, 06:17 PM
  3. Replies: 13
    Last Post: 12-14-2016, 05:25 PM
  4. Replies: 2
    Last Post: 10-04-2016, 10:41 AM
  5. form with variable field number
    By FRSPA in forum Access
    Replies: 10
    Last Post: 05-04-2011, 05:29 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums