Re: Sub Form Combo Box



"Dan @BCBS" <DanBCBS@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:7FD50886-84E8-4965-B5F9-9FBA7B3411E8@xxxxxxxxxxxxxxxx
I feel reall dumb asking this but your comment "where SubformControl is
the
name of the control containing the subform, NOT the name of the subform
itself."

"Control Containing the Subform"??

I'm not sure what the difference is!!

Private Sub TR_ACKNOWLTR_AfterUpdate()
If Me.TR_ACKNOWLTR <> " " Then
Me!frmCaseLog.Form!CA_NAME.RowSource = "Select * from tblCommitteeName
where
[C_Committee] = 'CG'or 'IR'"

Me!frmCaseLog.Form!CA_NAME.Requery

End If
End Sub


Thanks





"J_Goddard via AccessMonster.com" wrote:

When do you expect this event to happen? A user entering a date in a
text
box will not cause the GotFocus event to happen unless 1) the combo box
is a
tab stop and it is next in the tab order OR 2) the user clicks in the
combo
box. Maybe you want to put the code in the after update event of the
text
box?

Where are the two controls? If the textbox is on the main form and the
combo
box is on the subform, refer to it as:

Me!SubformControl.form!CA_NAME,

where SubformControl is the name of the control containing the subform,
NOT
the name of the subform itself.

You could try adding the line:

Me!SubformControl.form!CA_NAME.Requery


John


Dan @BCBS wrote:
I don't understand why this code does not work.
When the user enters a date in a text box the subform combo box
(CA_NAME)
should only show two choices.

But nothing happens, no error, nothing..

Help please....

Private Sub TR_ACKNOWLTR_GotFocus()
If Me.TR_ACKNOWLTR <> " " Then
Me!frmCaseLog!CA_NAME.RowSource = "Select * from
tblCommitteeName
where [C_Committee] = 'AG'or 'AL'"

End If
End Sub

--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access-formscoding/200802/1

Open your form in design view. Click once on the subform. Look at the
property ***'s caption. This is a subform control. What it does is to
provide a placeholder for the form which is to be used as the subform. It is
said to 'host' the form object - ie it is a container control (think of it
like the image control, which hosts an image, except that in this case it
hosts another form).

When you refer to these objects in code, just follow the name of the subform
control with .Form to refer to controls/properties etc. on the subform
itself.

Hope that helps


.