Using cmd_click

  • Thread starter Thread starter Chris
  • Start date Start date
C

Chris

Howdy.
Using the NotInList event of the ComboBox, is it possible to use the
code cmd_click.

I was having alot of problems with the Not In List event running the code
but I have everything working using the command buttons.

I get the error: runtime error 438. Object Doesn't Support this property
or event.

Forms!frmClientSOAInput.Form!frmStatementofAffairs.cmdOpen_Click
 
Chris said:
Howdy.
Using the NotInList event of the ComboBox, is it possible to use the
code cmd_click.

I was having alot of problems with the Not In List event running the code
but I have everything working using the command buttons.

I get the error: runtime error 438. Object Doesn't Support this property
or event.

Forms!frmClientSOAInput.Form!frmStatementofAffairs.cmdOpen_Click

Event procedures are, by default, private, so by using a fully-qualified
reference like this you are trying to execute a private procedure from
outside it's module. No can do.

If, as I understand from your question, the procedure you are trying to
execute is in the same module as the procedure you are calling it from, then
there is no need to fully-qualify your reference. Simply call the procedure
by it's name only i.e.

cmdOpen_Click

That should work.
 
Good afternoon

You need to code the NotInList event handler along the lines of

Private Sub YourCombo_NotInList(NewData As String, Response
As Integer)

If MsgBox("Do You Wish to continue with new Value for
'Combo Data Type'", vbYesNo) = vbYes Then
DoCmd.OpenForm "YourFormName", acViewNormal, , ,
acFormAdd, acDialog, NewData
Response = acDataErrAdded
Else
YourCombo.Undo
Response = acDataErrContinue
End If

End Sub

The form is opened modal so that the information may be
added to the relevant table before the Response parameter
is set. The NewData is passed as the OpenArgs so that it
can be used in the form without the user having to enter it
again.

Best Regards

Maurice St-Cyr
Micro Systems Consultants, Inc.
 
Back
Top