[AccessD] Code Issues Again

Joseph O'Connell joconnell at indy.rr.com
Tue Feb 22 22:08:35 CST 2005


Joe,

You can limit the user to only selecting Yes or No by using an Option Group.
If there is a box for Yes and a box for No, then checking one box will clear
the other.

Joe O'Connell

-----Original Message-----
From: Joe Hecht <jmhla at earthlink.net>
To: AccessD <AccessD at databaseadvisors.com>
Date: Tuesday, February 22, 2005 9:53 PM
Subject: [AccessD] Code Issues Again


|
|
|
|
|
|The Scenario:
|
|The client wants yes and no check boxes on a report.
|
|On the form I have yes no check boxes on the form.
|
|Selecting both yes and no on the same group is  a logic error.
|
|The problems:
|
|1. The code only fires one time per form.
|2. After it triggers and you click ok it goes to the next product. On
|clicking the ok button I need to stay on the same record.
|a. Am I using the wrong event?
|b. I tried using the me.currentrecord but could not find a way to write
|the code.
|
|3. I have two fields for each item. If  there is one yes/no field on
|the form is there code  to mark yes and no boxes on the report.
|
|The code follows.
|
|Thanks
|
|Joe
|
|
|I
|
|
|
|
|
|
|
|
|Private Sub Form_BeforeUpdate(pintCancel As Integer)
|
|    Dim lngRetval As Long
|
|    If txtProdMatCert = True And txtProdMatCertn = True Then
|
|
|        lngRetval = MsgBox( _
|            "You have selected both YES and No for Material
|Certificationthis item." & vbCrLf & "Please select Yes or No.", _
|            vbOKOnly + vbCritical + vbDefaultButton1, _
|            "Coflicting Yes No Message")
|
|        Select Case lngRetval
|            Case vbOK
|        End Select
|
|    End If
|
|            If ProdSpecialCertification = True And ProdSpecialCertification
|= True Then
|                  lngRetval = MsgBox( _
|                  "You have selected both YES and No for Special Process
|Certification." & vbCrLf & "Please select Yes or No.", _
|                  vbOKOnly + vbCritical + vbDefaultButton1, _
|                 "Coflicting Yes No Message")
|
|                     Select Case lngRetval
|                     Case vbOK
|                     End Select
|            End If
|
|
|    'TVCodeTools ErrorHandlerStart
|PROC_EXIT:
|    Exit Sub
|
|PROC_ERR:
|    MsgBox Err.Description
|    Resume PROC_EXIT
|    'TVCodeTools ErrorHandlerEnd
|
|End Sub
|--
|AccessD mailing list
|AccessD at databaseadvisors.com
|http://databaseadvisors.com/mailman/listinfo/accessd
|Website: http://www.databaseadvisors.com







More information about the AccessD mailing list