Results 1 to 1 of 1
  1. #1
    Join Date
    Dec 2002
    Location
    Houston, Texas
    Posts
    74

    Unanswered: I GOT IT WORK :::: Form: Prompt messages on the mandatory fields...

    Hello, I have a form where end user add new record. However, [GA_Number], [Plan_Num] and [PYE] are primary key and they must enter. I did following but it's not working. End user have been complaining that they enter all the info and it's not saving. What happen is they miss one of the mandatory field to fill. ============================================
    Version: Access 97
    Form: frmAddNewRecord

    Form properties:
    1. On Before Update:
    Cancel = Not AddRecorddataOK
    ============================================
    Form: Close button propeties
    1. There is a close button on the Form called "CLOSE"
    On Close
    If AddRecorddataOK = True Then DoCmd.close
    ============================================
    Form: > Properties > Format > Close Button > Select "No"
    ============================================
    Private Function AddRecorddataOK() As Boolean
    'Assume success
    AddRecorddataOK = True

    'Now test force mandatory fields
    If Nz(Me![GA_Number], "") = "" Then
    MsgBox "You have not entered the GA Number", vbOKOnly + vbExclamation
    AddRecorddataOK = False
    ElseIf Nz(Me![PlanNum], "") = "" Then
    MsgBox "You have not entered the VSystem Trac ID Number", vbOKOnly + vbExclamation
    AddRecorddataOK = False
    ElseIf Nz(Me![PYE], "") = "" Then
    MsgBox "You have not entered the Plan Year End", vbOKOnly + vbExclamation
    AddRecorddataOK = False
    End If
    End Function
    ============================================
    Last edited by doran_doran; 05-08-03 at 14:21.

Posting Permissions

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