Nick,
not sure what is going on with your form.
Get some more info by stepping through the code.
Put the line
Debug.Print "frame: " & Len(Me.Frame40 & vbNullString)
between the line with private sub and the next line like this:
Private Sub Frame40_BeforeUpdate(Cancel As Integer)
Debug.Print "frame: " & Len(Me.Frame40 & vbNullString)
If Len(Me.Frame40 & vbNullString) = 0 Then
Now click in the far left margin opposite the line Private sub Frame 40 etc
until the line goes red,
this tells the code window to open at this line when the form is running.
Press Ctl + G to turn on the immediate window.
So save the form and open it normally.
Click in frame40 and make a selection.
The code window will open.
Press F8, each press of F8 moves the cursor to the next line of code.
You will be able to see the value for the frame: in the immediate window
after the cursor moves to the next line.
If there are any errors, you will be able to see them happen.
Post back with the results.
Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia
Nick said:
I have entered code as shown in the frame40 of the subfrom but it does not
respond I also tried it in form but it too does not work, what other
information do you require?
Private Sub Frame40_BeforeUpdate(Cancel As Integer)
If Len(Me.Frame40 & vbNullString) = 0 Then
Cancel = True
MsgBox "Select overtime type"
End If
End Sub
Jeanette Cunningham said:
Nick,
one way is to use the before update event of the form.
You can test to see if the frame has a value or is null/empty string.
If you find that it has no value, you cancel the update and code a
message box something like this.
Private Sub Form_BeforeUpdate(Cancel as Integer)
If Len(Me.NameOfFrame & vbnullString) =0 Then
Cancel = True
MsgBox "Enter a value for ...")
End If
End Sub
Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia
Nick said:
I have a sub form that has a text box , and if you enter a number in it
[OTDLhoursused] it is tobe catagorized by selecting one of four radio
button
in a radio button frame [Frame 40] holding 5 radio button. The number
is
entered but sometime the radio button in not selected , How can I set a
reminder should some not select the botton and then have the reminder
go
away
once they have selected button and tabing over to the next text box.