Type mismatch error

  • Thread starter kevins \(remove this\)
  • Start date
K

kevins \(remove this\)

I have 'cribbed a bit of code that allows a user to double
click a combo box to open a form that allows you to add an
item to the table if if is not present, update the table
and subsequently, updates the field that thwe user
originally double clicked. I have addded this event
procedure to the doublice click event but I get a type
mismatch error. Here's the code - any clues?
Thanks

Private Sub COMBO73_DblClick(Cancel As Integer)
On Error GoTo Err_COMBO73_DblClick
Dim lngCOMBO73 As Long

If IsNull(Me![Combo73]) Then
Me![Combo73].Text = ""
Else
lngCOMBO73 = Me![Combo73]
Me![Combo73] = Null
End If
DoCmd.OpenForm "frmSECTOR", , , , , acDialog, "GotoNew"
Me![Combo73].Requery
If lngCOMBO73 <> 0 Then Me![Combo73] = lngCOMBO73
Exit_COMBO73_DblClick:
Exit Sub

Err_COMBO73_DblClick:
MsgBox Err.DESCRIPTION
Resume Exit_COMBO73_DblClick
End Sub
 
G

Greg Kraushaar

Why not use the OnNotInList event instead
Whenever an entry does not match the list, pop up a msgbox
I'm sorry Dave I can't find that. Do you want to try again, or do you
want to add the Sector to the list...
then take the approriate action
(Assumes 97 or later)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top