Double Click expression error?

denileigh

Registered User.
Local time
Today, 00:09
Joined
Dec 9, 2003
Messages
212
Hello,

I currently have a combo list on a purchase order form that has the following event procedure(s) in it so as to open the inventory window as needed to add/edit inventory.

Not in List:
Private Sub Combo55_NotInList(NewData As String, Response As Integer)
MsgBox "ERROR: ITEM not in list. Double-click this field to add an entry to the list."
Response = acDataErrContinue
End Sub

On Double-Click:
Private Sub Combo55_DblClick(Cancel As Integer)
On Error GoTo Err_Combo55_DblClick
Dim lngCombo55 As Long

If IsNull(Me![Combo55]) Then
Me![Combo55].Text = ""
Else
lngCombo55 = Me![Combo55]
Me![Combo55] = Null
End If
DoCmd.OpenForm "INVENTORYITEMSform", , , , , acDialog, "GotoNew"
Me![Combo55].Requery
If lngCombo55 <> 0 Then Me![Combo55] = lngCombo55

Exit_Combo55_DblClick:
Exit Sub

Err_Combo55_DblClick:
MsgBox Err.Description
Resume Exit_Combo55_DblClick

This works GREAT on other forms I have however, on this particular form it gives me the following error:


ERROR:
You have tried to assign the null value to a variable that is not a variable data type.

I have started from scratch several times....can anyone help? Is there anyway to add a button to the form to open the inventory form and then requery the combo box when closing the inventory form?

Thanks,
Dianne
 
Setting Response = acDataErrAdded will cause the ComboBox to requery so your Requery is not needed. Why not pass the "NewData" to the INVENTORYITEMSform in the OpenArgs and use acFormAdd in the DataMode argument to put the next form in Add Mode.
 
Umm...because I have no idea how to to that. lol I use alot of surfing the forums and cut and paste.

If you think that would work better, just tell me how and I'll change things that way.

Thanks for your reply!
 
Post back if you want further assistance. I happen to like ComboBoxes.
 

Users who are viewing this thread

Back
Top Bottom