A
Andre C
I have created my own switchboard which comprises labels which
hyperlink to the forms. On one form I am getting the following
problem:
I open it to edit. On the form is a combobox to select the record.
next to the combobox is an option button which when selected will
filter the combobox list (else the contents are too large.)
The form opens fine. If you just exit without doing anything this is
also fine. (I have a close button on the form) However if I find a
record and then close the form the form disappears but immediately the
form opens in addnewrecord mode and asks for a criteria for the option
button.
the code in the close button is
Private Sub closebttn_Click()
On Error GoTo Err_closebttn_Click
If Birthdate > Amit_date Then
MsgBox ("This child was admitted before they were born. Please
correct.")
Exit Sub
End If
DoCmd.GoToRecord , , acNewRec
DoCmd.Close
Exit_closebttn_Click:
Exit Sub
Err_closebttn_Click:
'usual error is because ICS number is null though the field is
required.
DoCmd.Close
End Sub
I do not remember why I put in DoCmd.GoToRecord , , acNewRec line. I
beleive it was to make sure the record was stored. But it makes no
difference even if I comment it out. The error still happens.
What I have noticed is that I also have a label on the switchboard to
open the form in addrecord mode above. If I open the form that way,
then close it and then open the record in normal mode I do not get the
criteria box.
Any ideas.
hyperlink to the forms. On one form I am getting the following
problem:
I open it to edit. On the form is a combobox to select the record.
next to the combobox is an option button which when selected will
filter the combobox list (else the contents are too large.)
The form opens fine. If you just exit without doing anything this is
also fine. (I have a close button on the form) However if I find a
record and then close the form the form disappears but immediately the
form opens in addnewrecord mode and asks for a criteria for the option
button.
the code in the close button is
Private Sub closebttn_Click()
On Error GoTo Err_closebttn_Click
If Birthdate > Amit_date Then
MsgBox ("This child was admitted before they were born. Please
correct.")
Exit Sub
End If
DoCmd.GoToRecord , , acNewRec
DoCmd.Close
Exit_closebttn_Click:
Exit Sub
Err_closebttn_Click:
'usual error is because ICS number is null though the field is
required.
DoCmd.Close
End Sub
I do not remember why I put in DoCmd.GoToRecord , , acNewRec line. I
beleive it was to make sure the record was stored. But it makes no
difference even if I comment it out. The error still happens.
What I have noticed is that I also have a label on the switchboard to
open the form in addrecord mode above. If I open the form that way,
then close it and then open the record in normal mode I do not get the
criteria box.
Any ideas.