How do I set a checkbox to equal a text value?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jdusn1978
    New Member
    • Feb 2016
    • 18

    How do I set a checkbox to equal a text value?

    Question: How do I get the Y/N checkbox fields to display a set sentence of text in a report? Or better yet, into another field such as a memo field?

    Super noob here. On a scale of 1-10 being how much I'll understand your response, I'll probably be between 2-6 depending on how complicated your answer is. With 6 meaning I will probably still have trouble understanding answer even if very basic. But I'll appreciate your time and answer and be better off than where I am now.

    Example: On the form there is a paragraph with a checkbox next to it. Read likes the paragraph and selects it. I generate a report at the end of the month to send to another user (I'm the middle man). I want the report to have the text, not Y or N or 1, -1, etc.

    Background: My database has a table with several Y/N checkbox fields. This is so that a user can just check which options he wants via the form. As an example those columns are labeled as: Column1, Column1a, Column1b, Column2, Column2a, Column2b and so on. In design view the descriptions currently contain what each Y/N column represents. For example: Column1 description: Location and type. Column1a is a sub-selection under Column1 and has the description: Confirm Location of whatever.... Column1b description reads: Confirm type of whatever...

    When the user selects these Y/N options they are essentially saying that they are wanting an answer to confirm the location and type of whatever. Why the box? Because the questions that can be asked are standardized but rather long. They are attached to a justification for the work that needs to be done. There is a memo field for freetext for additional explanation of the users question.

    Now, I have to send a report to the person who is going to do the work to answer the question. Obviously he does not want a sheet with a bunch of Y/Ns on it. I need the report to display those text descriptions. How do I accomplish this?

    I would like to generate a text paragraph from the Y/N checkbox descriptions and populate that into the memo field along with their free text if possible.
  • NeoPa
    Recognized Expert Moderator MVP
    • Oct 2006
    • 32661

    #2
    I'd use an IIf() construct.

    IE. In the report, or whatever you're creating, there would be text data in a TextBox control. The .RecordSource should be set similar to this :
    Code:
    ='Some standard blurb' & 
     IIf([Column1],'Column1 question included',Null) & 
     'Other standard blurb' & 
     IIf([Column1a],'Column1a question included',Null) & 
     '.'
    I've spread these over multiple lines for easier viewing but you wouldn't do that in your version. [Column1] & [Column1a] refer to the checkbox, or boolean, data. This will probably be from data saved in a table rather than from the form so make your own references work.

    Comment

    • jdusn1978
      New Member
      • Feb 2016
      • 18

      #3
      Thank you. I'm at work and utilizing your answer; however, I get "Some standard Blurb" in the textbox on a practice report I created no matter whether Column1 is checked or not.

      Here's my set up:

      tbl_CategoryAir fields
      Fields: Datatype: Description(tex t I need)
      1LocationType Y/N Determine location & type of AF
      1aConfirmLocati on Y/N -Confirm location via gecoords
      1bConfirmType Y/N -Confirm type (comm,mil,priva te)
      Text Memo Freetext

      I have more to this table and 19 other tables that are similar. The text stays pretty much the same except for the actual geographical item in question(table category name). For example the next table is:

      tbl_CategoryPor ts
      Fields: Datatype: Description(tex t I need)
      1LocationType Y/N Determine location & type of Port
      1aConfirmLocati on Y/N -Confirm location via gecoords
      1bConfirmType Y/N -Confirm type(comm,mil,p rivate)
      Text Memo Freetext

      These options are available through a subform which changes depending on the category selection on another table. "Above" these 19 category tables is a table that has a combobox: Select Geographical Survey Category with CategoryAirfiel ds, CategoryPortFac ilities, etc. Selecting Category Airfields would give you the subform related to the Airfields table and my checkboxes with the free text memo field.

      In the end I need the description text. I only made checkboxes for easy use by the user. Dropdowns were too much; the freetext memo field is actually the 26th field in the table. I wish that all my yes's and no's would actually show up as text in the memo field like this:

      To: Geographical Survey People
      From: JDUSN1978

      Request: Provide geographical survey of coastal land in Florida for potential private and commercial use Port Facility.

      Location: SE Florida, east coast, between Miami and Fort Lauderdale.

      Type: Up to commercial use.

      Return Report Guidance:
      Determine location and type of port facility.
      - Confirm location via geo-coordinates DDMMSSN/S DDDMMSSE/W.
      - Conform the potential type of port facility.

      What is the current status of the are of the potential port facility?
      - Is it occupied?
      - Is the land clear or vegetated?
      - IS any portion of the land currently under construction?

      This return report guidance is the part I'm struggling with how to create. Getting the 1, 1a, 1b, 2, 2a, 2b etc to place formatted text, currently sitting in the description field, into the memo field or another place that works. If I could view it in a sub form next to the checkboxes and as you click they appear in a subform page that would be awesome. Then the user could change and/or add to what the checkboxes generate and save it as the memo in the table.

      Thanks in advance for taking a look at this, I really appreciate it!

      Comment

      • NeoPa
        Recognized Expert Moderator MVP
        • Oct 2006
        • 32661

        #4
        You may be misinterpreting the code there. Only the stuff within the parentheses of the IIF() part is conditional. The other stuff is all constant and displays under all circumstances.

        Let me know if that doesn't answer your problem and I'll see what else I can do for you.

        Comment

        • jdusn1978
          New Member
          • Feb 2016
          • 18

          #5
          Yep, I was over-complicating your reply. Got it to work in a query, not the actual Memo Field in the table. There I get error 3344 "does not recognize [1LoctionType].....". So I am thinking of using it in an Append Query to the memo field. Or to a textbox that can be manipulated further and saved to the memo field upon update. Any suggestions?

          And the next step is to learn how to format these sentence returns with certain spaces between paragraphs.

          Thank you!!

          Comment

          • NeoPa
            Recognized Expert Moderator MVP
            • Oct 2006
            • 32661

            #6
            Originally posted by JDUSN1978
            JDUSN1978:
            Any suggestions?
            I'm afraid not. I don't really understand what you're saying TBF. Anyway, if you have further questions then please ask them in separate threads. Linking to this one is perfectly acceptable, but focus on making what you want clearly understood. It's hard to help when you don't understand what's being requested.

            Comment

            Working...