PaulChilds
Technical User
- May 21, 2002
- 195
I have created a database for all my movies. On the main form are various fields, including several drop down lists. I have a NotInList procedure setup which says to double click to add a new entry to the list. OnDblClick opens the new mini-form and requeries the records. When I exit the mini-form I can then choose the new entry in the drop down list.
However, if I decide that I made a mistake and wish to re-enter the mini-form, when I double click the box I get a 'Type Mismatch' error. This error will not go away unless I first delete the entry from the box and tab out of it, which is a bit of a pain. Can anyone help.
Below is the code I have used for OnDblClick (the field is called AspRat and the Mini-form is called Asp):
Private Sub AspRat_DblClick(Cancel As Integer)
On Error GoTo Err_AspRat_DblClick
Dim lngAspRat As Long
If IsNull(Me![AspRat]) Then
Me![AspRat].Text = ""
Else
lngAspRat = Me![AspRat]
Me![AspRat] = Null
End If
DoCmd.OpenForm "Asp", , , , , acDialog, "GotoNew"
Me![AspRat].Requery
If lngAspRat <> 0 Then Me![AspRat] = lngAspRat
Exit_AspRat_DblClick:
Exit Sub
Err_AspRat_DblClick:
MsgBox Err.Description
Resume Exit_AspRat_DblClick
End Sub
However, if I decide that I made a mistake and wish to re-enter the mini-form, when I double click the box I get a 'Type Mismatch' error. This error will not go away unless I first delete the entry from the box and tab out of it, which is a bit of a pain. Can anyone help.
Below is the code I have used for OnDblClick (the field is called AspRat and the Mini-form is called Asp):
Private Sub AspRat_DblClick(Cancel As Integer)
On Error GoTo Err_AspRat_DblClick
Dim lngAspRat As Long
If IsNull(Me![AspRat]) Then
Me![AspRat].Text = ""
Else
lngAspRat = Me![AspRat]
Me![AspRat] = Null
End If
DoCmd.OpenForm "Asp", , , , , acDialog, "GotoNew"
Me![AspRat].Requery
If lngAspRat <> 0 Then Me![AspRat] = lngAspRat
Exit_AspRat_DblClick:
Exit Sub
Err_AspRat_DblClick:
MsgBox Err.Description
Resume Exit_AspRat_DblClick
End Sub