G
Guest
Hello,
I have a form for students to Sign In on. The Testing
proctor is able to select required fields by going into
an options form and select or deselect what they want
required on the Student Form.
The Options form is based of a table that as one record
with all the options.
Here is my problem I'm using Dlookup to see if the option
has been checked. If it has it requires the field and
displays a popup. If it hasent it just closes the form.
At first I had a Cmdbutton to close the form and put the
dlookup code in the form before update. That displayed a
error "You cancled previous Operation" That didnt work
so I put the code in On Click for the cmdbutton. This
also does not work. When the field is required it works,
but if it not the cmd button does nothing.
Here is the code
Private Sub SaveCmd_Click()
If (DLookup("TocOpt", "DbOptionsTbl")) = True Then
If IsNull(TOC) = True Then
MsgBox "Please Select the Type of Class YouAre In.",_
vbOKOnly + vbExclamation
TOC.SetFocus
Cancel = -1
DoCmd.close
If (DLookup("TocOpt", "DbOptionsTbl")) = False Then
DoCmd.close
End If
End If
End If
End Sub
Any help would be great
Thank You
David Ehrenreich
I have a form for students to Sign In on. The Testing
proctor is able to select required fields by going into
an options form and select or deselect what they want
required on the Student Form.
The Options form is based of a table that as one record
with all the options.
Here is my problem I'm using Dlookup to see if the option
has been checked. If it has it requires the field and
displays a popup. If it hasent it just closes the form.
At first I had a Cmdbutton to close the form and put the
dlookup code in the form before update. That displayed a
error "You cancled previous Operation" That didnt work
so I put the code in On Click for the cmdbutton. This
also does not work. When the field is required it works,
but if it not the cmd button does nothing.
Here is the code
Private Sub SaveCmd_Click()
If (DLookup("TocOpt", "DbOptionsTbl")) = True Then
If IsNull(TOC) = True Then
MsgBox "Please Select the Type of Class YouAre In.",_
vbOKOnly + vbExclamation
TOC.SetFocus
Cancel = -1
DoCmd.close
If (DLookup("TocOpt", "DbOptionsTbl")) = False Then
DoCmd.close
End If
End If
End If
End Sub
Any help would be great
Thank You
David Ehrenreich