Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2009

    Unanswered: Msgbox to prevent empty fields on a form


    I am semi new to access and have a form completed. The form is utilized on a production floor to record in-process work and inspection data. I want to add a event procedure on "click" to my "end shift" button I have created that exits the form to a main menu when the shift is compelted. I want this event to look at all my colums for empty fields to prevent missing data.

    I have got an example I copied to kind of work below in blue... the problem is that it only will look at the ACTIVE record I am on. I am using a continous form so multiple records show on the screen. I have to do this so the operators can see the status of multiple jobs being run on a line at one time and fill out the fields as they get the results. How do I get it to look at all active records on the screen when i hit the End shift button?

    I have attatched the access file for review. The form im using is called production form.

    Private Sub Command234_Click()

    If IsNull(Shift) Then msg = msg & "Shift" & vbCrLf
    If IsNull(Customer) Then msg = msg & "Customer" & vbCrLf

    If IsNull(msg) Then
    'go ahead and do whatever the button is supposed to do
    msg = "Missing value in:" & vbCrLf & msg
    MsgBox msg, vbInformation, "Operator Error!"
    End If
    Attached Files Attached Files

  2. #2
    Join Date
    Nov 2007
    Adelaide, South Australia
    Run a report instead?

    Normally you'd validate data before updating it, rather than have the user click a button to validate all records.
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!

    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts