Page 1 of 2 12 LastLast
Results 1 to 15 of 17
  1. #1
    TomH is offline Novice
    Windows 7 64bit Access 2016
    Join Date
    Dec 2017
    Posts
    10

    Create a pop-up text box predicated on field content


    I have a form with a check box for "Deceased". I would like a more noticeable indication that this person is deceased. I know I can use Conditional Formatting to change color(s) in any or all fields, but I would prefer a simple "Deceased" to appear on the form.
    I'm a real novice, so if it requires coding, please tell me where to place any code you might supply. I do NOT want any buttons or controls in the box, just the word "Deceased". I'm assuming it would disappear as I browse to the next record.

    Thanks,

    TomH

  2. #2
    Micron is online now Virtually Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    Assuming the form is based on a table or field whose data type is one of: Y/N, T/F, 1,0, then you could have an additional unbound textbox with an expression to show the correct word according to the checkbox state, which you don't even need to show anymore. If checked is deceased, then in that textbox:
    =IIf([MyChecbox]=True,"Deceased","Alive")
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  3. #3
    TomH is offline Novice
    Windows 7 64bit Access 2016
    Join Date
    Dec 2017
    Posts
    10
    Micron,

    Thanks for the prompt reply. Yes, the "Deceased" checkbox is a yes/no data-type field in the table that the form is built on. I only want the pop-up text box if the person is deceased, otherwise, no pop-up.
    If you scroll to the previous or next record, and that person is not deceased, the box should disappear with no other action than scrolling through the records. Thanks again for your time and efforts.

    TomH

  4. #4
    Micron is online now Virtually Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    the box should disappear with no other action than scrolling through the records
    Then you will have to use the form's Current event and hide/show the text box if the value for that Boolean (Y/N) field is True. It would only disappear on the next record if the value became False.

  5. #5
    TomH is offline Novice
    Windows 7 64bit Access 2016
    Join Date
    Dec 2017
    Posts
    10
    Micron,

    You are giving me far too much credit with respect to my Access knowledge. I have not a clue as to how to use the form's Current Event procedure to accomplish this. When it says "Novice" by my name, it is an overstatement.
    If you could explain, in detail, it would be greatly appreciated. If not, thanks anyway for taking the time to get involved. That too, is greatly appreciated.

  6. #6
    Micron is online now Virtually Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    If you don't know how to put the form in design view, have the property sheet open, select the Event tab, locate the On Current event and click the ellipses to invoke either the vb editor to write code or invoke the macro builder, then either write code or build a macro, this becomes a course on Access and is too much to explain here. You could post a zipped copy of your db with basic instructions on what's needed and I or someone else should be able to accommodate you. The tricky part is whether or not your db can be opened with older versions. If you've used incompatible features, then I cannot. Remedy would be to post a stripped down db with only the tables/forms needed for this, with dummy data if it's private, and ensure the tables don't include incompatible features. I couldn't find a page explicitly for 2016, so I gather not much has changed from 2010 to 2016. Here's what won't work in 2007.

  7. #7
    TomH is offline Novice
    Windows 7 64bit Access 2016
    Join Date
    Dec 2017
    Posts
    10
    Micron,
    Thanks for your time, expertise, and offer. It is, seemingly, an incredibly simple application for my high school graduating class. Only two (2) tables consisting of: (1) a States table with their full name and 2 letter postal ID (that should not require any maintenance), and (2) a Classmates table with 16 fields, and 230 records, that will never require a new record. It only uses one (1) split form. I haven't gotten in to queries or reports yet, but do not anticipate many problems in those areas. Right now, I'm just trying to bullet-proof the editing capabilities for when I turn it over to someone else to manage. It was so easy to code in Foxpro 2.6 DOS, with UDF's, and still works flawlessly under Windows 7-64 bit, but I am really struggling with Access, as you have perceived. However, when it is time to turn it over to someone else, I wanted a turn-key Windows application and not a kludged-up fix for a 16 bit DOS program running in a 64 bit Windows OS. I'll have to give it some more thought but, again, thanks for your time and efforts.
    TomH

  8. #8
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,825
    Have you studied an introductory tutorial book?

    You originally asked for a textbox to display "Deceased". Micron described how to do that in post 2 which does not require any programming (macro or VBA). Then in post 3 you ask for a 'popup'. This requires macro or VBA.

    Why would you want a popup? Did you try the textbox ControlSource expression? Since you have designed a form and even know what Conditional Formatting is, I presume you are familiar with how to create textbox on form and the Properties Sheet.
    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
    TomH is offline Novice
    Windows 7 64bit Access 2016
    Join Date
    Dec 2017
    Posts
    10
    My apologies. I assumed, (usually a bad idea), from looking at the code in post #2 that the box would always be visible, showing either "Deceased", or "Living". I only wanted the box and message if deceased. I obviously used the wrong description (pop-up) for a message box that only appears if the person is deceased. I'll try and sort it out.
    Thanks for your time and comments.
    TomH

  10. #10
    Micron is online now Virtually Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    When you said popup, I didn't take it that you wanted a popup form even though that's what it means so I ignored that based on the rest of your posts. Yes, as per #2 the control would always be visible. Don't see why that would be an issue. You're only using the lack of visible information to infer an opposite, which is really not a good idea when it comes to information handling IMHO. Following that example, you'd at least accomplish something in the meantime while you teach yourself Access. Making it invisible is relatively easy Me.NameOfYourControl.Visible = False, but then you have to be concerned with bringing it back when needed. You don't seem to be taking advantage of the offer to fix your posted db just to get you started, so there's not much we can do. Not trying to be rude here, but the forum is for helping those who have some familiarity with Access (which does not mean you have to know much, but there is a lower limit) otherwise it would be a tutorial site, and there are LOTS of those out there already that could help you learn the basics. If we don't see a posted db, then I truly wish you good luck with your project.

  11. #11
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,825
    The textbox will always be there but it can be empty.

    =IIf([MyChecbox]=True,"Deceased",Null)
    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.

  12. #12
    Micron is online now Virtually Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    In which case formatting the borders to Transparent might help even more. Then no value, you see nothing at all. A value, just the word.

  13. #13
    TomH is offline Novice
    Windows 7 64bit Access 2016
    Join Date
    Dec 2017
    Posts
    10

    Create a TextBox Predicated On Field Content

    Thanks for the suggestions and comments. I'm attempting to attach the Classmates.accdb within a Classmates.zip. As a newcomer to this site, it is not readily apparent to me on how to proceed and, it may not succeed.

    Classmates.zip

  14. #14
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,825
    The file uploaded just fine. Not seeing the suggestion incorporated in db. Do you still have an issue to resolve?
    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.

  15. #15
    Micron is online now Virtually Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    I downloaded, can't open: Unrecognizable database format error. Tried importing into new db as well as opening with decompile switch - no luck.
    @TomH - if you can download and open your own attachment, then it's likely a version problem. You could try Save As... and choose an older version and see if it tells you what the offending feature is, or wait for someone here who's more up to date to help. If you can't, the zipped file is probably corrupt.

Page 1 of 2 12 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Viewing content of long text cells
    By mglevicky in forum Access
    Replies: 3
    Last Post: 01-23-2017, 09:38 AM
  2. Replies: 2
    Last Post: 01-03-2015, 07:18 PM
  3. Reports positioning boxes with text content
    By pierre86 in forum Reports
    Replies: 2
    Last Post: 09-15-2013, 01:05 PM
  4. Replies: 1
    Last Post: 08-13-2013, 09:39 PM
  5. Replies: 4
    Last Post: 01-23-2012, 09:07 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