Results 1 to 5 of 5
  1. #1
    Rob_R is offline Novice
    Windows 10 Access 2019
    Join Date
    Oct 2022
    Posts
    4

    Conditional filling a textbox

    Hi,



    I would like to know if it is possible to fill 8 textboxes on a form depending on the last two letters/digits. This is so I can "draw" a plate that can receive electronic cards. The numbering of the slots for the cards is something I have to deal with this because it is read like that from a textdump. There are 8 slots, the slots can be numbered from 01 to 08, or the first two slots can also be 00 and 00, and the slots can end with a letter, like AA BB CC DD. The table I read from might not have all slot occupied and then the textbox should be empty (space for a new card) I will try to clarify this in the table below.
    0 or 1 or A (slot 1) 0 or 2 or A (slot 2)
    3 or B (slot 3) 4 or B (slot 4)
    5 or C (slot 5) 6 or C (slot 6)
    7 or D (slot 7) 8 or D (slot 8)

    Normal cards end with a number from 1 to 8. Redundant communication cards are always in slot 1 and 2 but the name ends with 0 and redundant non communication cars end with a letter A to D.
    Example:
    AI03 goes in slot 3
    CM00 goes in slots 1 and slot 2
    AI0D goes in the slots 7 and slot 8.

    So if there are cards in the table I would like to see the textboxes fill like this:
    CM00 CM00
    AI03
    AI0D AI0D


    Thanks in advance,
    Rob.

  2. #2
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,942
    So what happens when you have three CM00 ?
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  3. #3
    Micron is online now Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,803
    Quote Originally Posted by Welshgasman View Post
    So what happens when you have three CM00 ?
    My guess is that the data only contains 1 of CM00 but the rule would mean it needs to occupy 2 slots. I imagine that code is the only solution for this, given the amount of logic involved and the suggestion that there is a data dump of some sort that one has to deal with. If there is a way to use only a query to get the data into a table of 8 fields that the form controls are bound to I'm not seeing it.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  4. #4
    Rob_R is offline Novice
    Windows 10 Access 2019
    Join Date
    Oct 2022
    Posts
    4
    Quote Originally Posted by Welshgasman View Post
    So what happens when you have three CM00 ?
    Well, that is impossible. What I am trying is to visualize is a cabinet with 4 baseplates with 8 cards per baseplate. Only the first baseplate can have two communication modules in slot 1 and 2. The computer system wont allow to program more com modules at any other slot. There can be much more com modules in the system but only in other cabinets.

    Regards,
    Rob.

  5. #5
    Rob_R is offline Novice
    Windows 10 Access 2019
    Join Date
    Oct 2022
    Posts
    4
    Quote Originally Posted by Micron View Post
    My guess is that the data only contains 1 of CM00 but the rule would mean it needs to occupy 2 slots. I imagine that code is the only solution for this, given the amount of logic involved and the suggestion that there is a data dump of some sort that one has to deal with. If there is a way to use only a query to get the data into a table of 8 fields that the form controls are bound to I'm not seeing it.
    That is correct, the com modules are listed once in the data and the same goes for the redundant modules (A,B,C, or D)

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

Similar Threads

  1. Replies: 3
    Last Post: 07-18-2022, 09:05 AM
  2. Conditional Visible textbox
    By Sinclair in forum Reports
    Replies: 4
    Last Post: 05-13-2022, 08:39 AM
  3. Replies: 4
    Last Post: 01-10-2016, 01:03 PM
  4. Replies: 9
    Last Post: 10-04-2013, 11:48 AM
  5. Filling in blank textbox on a report.
    By cowboy in forum Reports
    Replies: 3
    Last Post: 04-16-2010, 02:50 PM

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