Results 1 to 7 of 7
  1. #1
    Join Date
    Jun 2021
    Location
    Gulfport, MS
    Posts
    3

    Text field to Yes/No

    Greetings,


    I am a novice developer tasked with converting an Excel document into an AccessDB.
    Goal: Convert Text Field containing “X” to “Yes/No” field.
    The “X” was utilized to annotate the member(record) has completed that item.

    E.g.
    Has member completed training?
    “X” = yes “ ” = no

    I wish to convert the “X” (yes) “ “ (no) method of tracking data to a check box “Yes/No” field.

  2. #2
    Minty is offline VIP
    Windows 10 Office 365
    Join Date
    Sep 2017
    Location
    UK - Wiltshire
    Posts
    3,003
    Access stores yes no fields as 0 (false) or -1 (true)

    So in your table replace X with -1 and everything else with 0, then convert to a yes no data type.or import accordingly.
    DLookup Syntax and others http://access.mvps.org/access/general/gen0018.htm
    Please use the star below the post to say thanks if we have helped !
    ↓↓ It's down here ↓↓

  3. #3
    Join Date
    Jun 2021
    Location
    Gulfport, MS
    Posts
    3
    I am working with over 500 records and 24 yes no questions per record.
    In order to convert to -1 0
    Excel function: If This”X” than “-1”; IfThis”” than “0”?

  4. #4
    Minty is offline VIP
    Windows 10 Office 365
    Join Date
    Sep 2017
    Location
    UK - Wiltshire
    Posts
    3,003
    In Excel I would use

    =IF(A1 ="x",-1,0)

    Replacing A1 with the source cell

    Or you could simply Press ctrl & H and do a global replace on whole cell contents in the range?
    DLookup Syntax and others http://access.mvps.org/access/general/gen0018.htm
    Please use the star below the post to say thanks if we have helped !
    ↓↓ It's down here ↓↓

  5. #5
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,914
    You would not hold 24 boolean fields for the questions in one record in Access (as you do in Excel)?
    So you could make the change as you 'normalize' the data?
    Each question should be it's own record.
    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

  6. #6
    Micron is online now Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,793
    As soon as I read post 2 I thought the data layout would be the typical problem posed by Excel users and it looks like that is the case. @Curious, I suggest you read up on db normalization (or you will likely be here often because of the lack) and consider this as well
    http://allenbrowne.com/NoYesNo.html

    Normalization Parts I, II, III, IV, and V
    http://rogersaccessblog.blogspot.com...on-part-i.html
    and/or
    http://holowczak.com/database-normalization/

    Then there's must-reads on bad words to use, naming conventions, table lookup fields, multi value field, autonumbers if you want to make your journey less painful. I have links for those if you want them.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  7. #7
    Join Date
    Jun 2021
    Location
    Gulfport, MS
    Posts
    3
    Thank you all for the information!

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

Similar Threads

  1. Replies: 7
    Last Post: 05-10-2021, 10:01 AM
  2. Replies: 24
    Last Post: 03-12-2019, 08:02 PM
  3. Replies: 7
    Last Post: 06-05-2015, 11:13 AM
  4. Replies: 12
    Last Post: 06-04-2012, 10:55 AM
  5. Replies: 2
    Last Post: 05-05-2010, 02:52 PM

Tags for this Thread

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