Results 1 to 6 of 6
  1. #1
    markjkubicki's Avatar
    markjkubicki is offline Competent Performer
    Windows 10 Office 365
    Join Date
    Jul 2010
    Location
    Fire Island Pines, NY
    Posts
    496

    text message, best practices


    I have an ACCESS project, which has a LOT of Forms/subForms. Often there will be user prompts, and this would be typical.
    Code:
            gsMsgText = "You have assigned 0-10v control to a fixture that may potentially be used for EM purposes." _
                & vbCrLf & "Certain jurisdictions require the fixture to comply with UL924" _
                & vbCrLf _
                & vbCrLf & "Do you want to add a UL924 requirement?"
            gsMsgTitle = "UL924"
            gsMsgResponse = MsgBox(gsMsgText, vbYesNo + vbDefaultButton2 + vbQuestion, gsMsgTitle)
    My Q. is:
    Is this an OK way of handling the info, or should the actual "texts" be stored in a table and the code be revised to lookup the text (rather than it being hard-coded)?
    Which is better practice?

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    If you want to be able to change the message in future without having to modify code, use table. Otherwise, hard-coded message is fine.
    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
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,940
    I think with info like that, you would be better off with a table?
    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

  4. #4
    markjkubicki's Avatar
    markjkubicki is offline Competent Performer
    Windows 10 Office 365
    Join Date
    Jul 2010
    Location
    Fire Island Pines, NY
    Posts
    496
    thnx!

    this is trivial but... is there a standard convention for this type of table?
    i'm thinking:

    - one table for all text on all forms

    - with multiple fields: FormName , Msg_no, MsgTTl_text, MsgTxt_text (allowing for multiple entries for any one form)

  5. #5
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,940
    I would have thought MsgNo and MsgText would be enough?
    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
    markjkubicki's Avatar
    markjkubicki is offline Competent Performer
    Windows 10 Office 365
    Join Date
    Jul 2010
    Location
    Fire Island Pines, NY
    Posts
    496
    works for me... thnx !

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

Similar Threads

  1. Display a field value in Message Box text.
    By sheusz in forum Programming
    Replies: 2
    Last Post: 06-11-2019, 10:01 PM
  2. display a message in a text box
    By mmaule in forum Access
    Replies: 2
    Last Post: 02-18-2015, 11:14 AM
  3. How to create a message box with bold text
    By uronmapu in forum Access
    Replies: 5
    Last Post: 07-12-2012, 03:09 AM
  4. the message #Name? in the text
    By grad2009 in forum Forms
    Replies: 7
    Last Post: 02-22-2010, 05:41 PM
  5. Text too long, error message
    By taylormotm in forum Access
    Replies: 13
    Last Post: 06-18-2009, 07:24 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