Option Group Question

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I've created an option group that consist of 4 radio buttons. As the customer
is entering the information, before they can save and go to the next
customer, the form needs to ask them for a delay reason, that is if they
didn't enter one already.
I don't want to put a default option, as this will be the answer 99.9% of
the time. In the properties box of the option group, on the after update
section, i put this code...

Private Sub DelayReason_BeforeUpdate(Cancel As Integer)
If Me.DelayReason = 0 Then
MsgBox "MUST INDICATE DELAY REASON", vbOKOnly, "Delay Reason"
DoCmd.GoToControl "DelayReason"
DoCmd.CancelEvent
End If

Unfortunately, nothing happens. You can save the page and go to the next
customer. I need for this to display if they don't enter a delay resaon.

I've created a new table called tbleDelayReason, and it has the 4 delay
reasons stored there. I've linked it to the Registration table, on the
Reason field, here is the relationship code: tblDelayReason INNER JOIN
tblRegistration ON tblDelayReason.ReasonID = tblRegistration.Reason;.

When I put Reason in the Control Source, I can't even get the default option
to appear, This I"m doing as a test, but when I omit the control source, the
default option will work, but the code won't check still.

I want to know if I'm doing this right, by using the code or control source?
Any light on this matter will definetly help.

Thasnks
 
The BeforeUpdate event of the control will not fire if the user does not use
the control.

Use the BeforeUpate event of the form instead.

Or, open the table in design view and set this field's Required property to
Yes. No code needed.
 
Back
Top