Open subform from List box

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

Guest

I have a list box populated from a table called tblTardies.

The list box, lstTardyAdd, is on a form, frmTardyAdd. I want a subform to
open on the frmTardyAdd when I click on an item in lstTardyAdd. The subform
is different for most of the items in the list box.

Anyone have code for that?
 
On the after update event of the list box you can enter the code

Select Case Me.lstTardyAdd
case 1 ' Enter the number of the Item on the list box
me.[SubFormNameOnTheForm].sourceobject="SubFormName1"
case 2
me.[SubFormNameOnTheForm].sourceobject="SubFormName2"
case else ' For any other item that doesn't apear on the case list
me.[SubFormNameOnTheForm].sourceobject="SubFormName3"
end select
 

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

Back
Top