Add-in combo Box

  • Thread starter Thread starter Christy
  • Start date Start date
C

Christy

In Access 2000 wizard, the inventory control, how does the
Products form work when you click on the category record.
You can type in a category then it updates the combo list
in the products form. I can not figure out how that works.

Thanks
 
Christy,

Open the Product form in design mode, click on the Category ID combo box,
open the properties dialog box, and look at the event procedures in the "On
Not In List" property, and "On Dbl Click" property.

The "Me![CategoryID].Requery" statement in the "On Dbl Click" event
procedure makes sure that the new category appears in the Category ID combo
box.

Hope this helps,
 
I have done those things in the database I am working on.
I am getting a Type mismatch error when I double click on
mine. Thanks for your help

christy
 
A line of code does not get highlighted. A box just
appears saying Type mismatch. Then when I go to the code
and click on Run, it asks me for a macro so I do not know
if that is the case. Below is my Dbl Click and my
NotInList code. (TYPE is the name of my record)

Private Sub TYPE_NotInList(NewData As String, Response As
Integer)
MsgBox "Double-click this field to add an entry to the
list."
Response = acDataErrContinue
End Sub

Private Sub TYPE_DblClick(Cancel As Integer)
On Error GoTo Err_TYPE_DblClick
Dim lngTYPE As Long

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

Exit_TYPE_DblClick:
Exit Sub

Err_TYPE_DblClick:
MsgBox Err.Description
Resume Exit_TYPE_DblClick

If you do not know the answer do not worry about it.
Thanks a bunch!!
 
Back
Top