opening cascading combo box

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a field in a subform that is in datasheet view. Upon entry into that
field [ProductDescription], I would like another form, which is a cascading
combo box [frmProjectSelect], to open up. I wrote the following in the On
Enter event procedure:

On Error Resume Next
DoCmd.OpenForm _
FormName:="frmProductSelect", _
View:=acNormal, _
WindowMode:=acDialog
Me!ProductDescription.SetFocus

When I enter that field in the subform, nothing happens. There is currently
a drop down combo box in that field. Do I need to remove that first for it
to work, or does something in my event procedure not appear correct?

Thank you!
 
Have you tried placing a break point in the code and see if you get there to
make sure the code is even running? If so, try stepping through the code and
see what happens. With your "On Error Resume Next", if there is an error,
nothing will happen because Access will simply ignore the error and
continue. Try commenting out the "On Error ..." statement until you get this
debugged, then put it back in. The problem could be as simple as a typo in
the form's name.
 
I am a little confused. I think you are opening a form and trying to SetFocus
to a control on the opened form. If that is correct the ME word refers to the
form in which the code is being executed. If you want a control on the opened
form you should refer to Forms(<OtherFormName>).<ControlName>.SetFocus
Cheers
Terry
 
Back
Top