View Single Post
  #1  
Old November 23rd, 2004, 05:01 PM
Tcs
external usenet poster
 
Posts: n/a
Default combo boxes on form with subform

I've made my one form into a subform. The subform displays the records I want
to see from only one table, based on selections I make in two combo boxes on the
main form.

When I open my form, all the fields of the subform show "#Name?".

If I put the table name where my data is, Combo box 1 shows all "Apps"
(MetaSchema) available. (This is correct.) I make my selection, then I move to
Combo box 2. Here's my "After _Update" for Combo Box 1 code to get my Combo Box
2 data:

Dim strSQL As String

strSQL = "Select distinct MetaSchema, CatalogVers from tblSubModules"
strSQL = strSQL & " where ((tblSubModules.MetaSchema)=" & Me!cbxMetaSchema &
")"
Me!cbxCatalogVers.RowSourceType = "Table/Query"
Me!cbxCatalogVers.RowSource = strSQL

When I click on the down arrow of combo box 2, I get a small "Enter Parameter
Value" window. (The pulldown list is empty.) It asks for the value of the
"Apps" I selected in Combo box 1. Needless to say, Combo box 2 is EMPTY.
Here's my "After _Update" for Combo Box 2 code to get the records to display on
my subform:

Dim strSQL As String

strSQL = "Select * from tblSubModules"
strSQL = strSQL & " where (((tblSubModules.MetaSchema)=" & Me!cbxMetaSchema &
") and "
strSQL = strSQL & " ((tblSubModules.CatalogVers)=" & Me!cbxCatalogVers & "))"
Me!cbxCatalogVers.RowSourceType = "Table/Query"
Me!cbxCatalogVers.RowSource = strSQL

MsgBox "strSQL...(" & strSQL & ")"

Me.frmSubModulesSub.Form!cbxCatalogVers.Requery

But I don't think it executes this, as I never see this MsgBox, which I put in
for debugging.

If anyone has any ideas/thoughts/suggestions (short of me giving up), I'd
appreciate hearing from you.

Thanks in advance,

Tom