Results 1 to 14 of 14
  1. #1
    peterr. is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Sep 2014
    Posts
    7

    change text in label consecutive through VBA

    Hi,



    first of all sorry for my bad English
    second, I have a question, how can I make my Db that when I choose a number from "MAS" the corresponding
    "dl's" (a through k) comes nicely below each other, so when I choose 100 a,b,h,j,k comes emerge.

    can someone help me with this ?

    http://members.upc.nl/h.vandegouw/voorbeeld.accdb

    Gr Peter

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,644
    That would require a UNION query.

    The table is not a normalized structure. This design will likely cause you lots of frustration.

    Normalize structure and a SELECT query could easily produce the output you want.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    peterr. is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Sep 2014
    Posts
    7
    A union query? why, a union query adds 2 table's into 1 isn't? how should I do this?
    (my knowledge of acces and sql is not so high)

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,644
    Example:

    SELECT ID, 1 AS Source, Field1 AS Data FROM table
    UNION SELECT ID, 2, Field2 FROM table
    UNION SELECT ID, 3, Field3 FROM table;
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    peterr. is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Sep 2014
    Posts
    7
    I think this is the intention? but how do I get it included in the label

    when I run the query the response is all possible choices in data 0 & -1 is that right?
    (see my Db in startpost)

  6. #6
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,644
    I did view your db and commented on it.

    Build the UNION query. Must type into SQL View of query builder.

    Then use that query as source for subsequent queries or the source for a report.

    Data in UNION query cannot be edited.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  7. #7
    peterr. is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Sep 2014
    Posts
    7
    Hi,
    Sorry, I doesn't understand it what you mean,
    In the link in my startpost I have added the query, I don't know how to build it further to add/edit the text automatically

  8. #8
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,644
    The UNION query I offered was an example. You must use your field names. There is no ID field in your table. Use your field names as appropriate. Perhaps replace ID with [MAS nummer].

    What is this table for? Why are there fields named a, b, c, d, e, f, g, h, i, j, k and these are also values in the [MAS nummer] field?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  9. #9
    peterr. is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Sep 2014
    Posts
    7
    this table is like an configuration table, we have different lists 100 trough 800 and to these lists another lists can be linked together,
    list 100 has lists a,b,h,j,k.
    my intention is the label name's nicely arranged under each other like in the form hard coded (updated link in start post)

  10. #10
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,644
    Did you edit the query?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  11. #11
    peterr. is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Sep 2014
    Posts
    7
    yes I edited it, when I run it stand alone I get an table with the [mas nummer] and 11 sources with -1 to the checked fields, only how can I
    translate it to the labels

  12. #12
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,644
    What do you mean by 'translate it to the labels'? Are you trying to print a sheet of labels?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  13. #13
    peterr. is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Sep 2014
    Posts
    7
    no I mean the label in the form

  14. #14
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,644
    Why would you want to have data show in label? Use a textbox bound to field.

    Why would you want this query on a form? Cannot edit the data. Perhaps you should build a report?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. Replies: 4
    Last Post: 02-21-2014, 01:29 AM
  2. Replies: 6
    Last Post: 01-16-2013, 12:12 PM
  3. Change size of Label
    By amerifax in forum Access
    Replies: 1
    Last Post: 10-17-2012, 06:18 PM
  4. Replies: 1
    Last Post: 03-29-2009, 08:27 AM
  5. Change of label size
    By Zoroxeus in forum Programming
    Replies: 0
    Last Post: 06-11-2007, 08:18 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