Results 1 to 5 of 5
  1. #1
    Join Date
    Jun 2015
    Location
    Wales. Land of the sheep.
    Posts
    1,228

    Simple (hopefully) Checkbox vailidation.

    I have a costing form attached to every job I have. At the top of this form there is a checkbox for 'obtained costs'. The user should click this once all of the additional costs are entered (the job will then be removed from jobs that require cost information.)

    I would like to attach a message box to this if the user hasn't entered any cost information in the "Txtcost" text box. Just so they are aware they didn't enter the value basically.

    I can get a message box to work on update, but not depending on another text box's value.

    Hope I've explained what I'm after well enough.

    Thanks.

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,648
    Record validation code customarily goes in the form BeforeUpdate event.
    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
    Jun 2015
    Location
    Wales. Land of the sheep.
    Posts
    1,228
    Okay, Im pretty useless with VBA/ coding. Would you be able to suggest some?

    The value is currency, If it =0 then msg box appears when checkbox is clicked.


    I don't want the form to validate anything. I want the users to be able to enter this information as and when they please. before or after the update doesn't really make a difference. because I want them to have the ability to enter 'wrong' information as long as they are aware they are doing so.

    just to confirm, its the checkbox I want to add the validation to.

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,648
    Then the validation is just to check whether or not the textbox has a value. Is textbox bound to a number type field?

    What do you want to happen if the checkbox is checked (True) and what if the checkbox is unchecked (False)?

    Suggest using the checkbox Change event, something like:

    If Me.checkboxname = True Then
    If IsNull(Me.textboxname) Or Me.textboxname = 0 Then
    MsgBox "say something"
    End If
    End If
    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.

  5. #5
    Join Date
    Jun 2015
    Location
    Wales. Land of the sheep.
    Posts
    1,228
    Thanks a lot. I know these are simple questions regarding VBA. I intend to spend some time learning at least the basics. Even that was a 50 hour series on youtube haha.

    the textbox is bound to a currency field, and the checkbox is basically just to take the job off a query (marks it as done).

    The query will show all completed jobs that do not have this true value. These can then be dealt with and once complete ticked off.

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

Similar Threads

  1. Replies: 1
    Last Post: 11-26-2014, 02:30 PM
  2. Checkbox
    By Mantaii in forum Forms
    Replies: 3
    Last Post: 01-13-2012, 07:17 AM
  3. Replies: 0
    Last Post: 10-21-2010, 08:24 AM
  4. Simple Export Not So Simple
    By jgelpi16 in forum Programming
    Replies: 11
    Last Post: 09-01-2010, 07:23 AM
  5. Checkbox
    By Rbtsmith in forum Access
    Replies: 2
    Last Post: 02-17-2009, 04:19 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