Subject: Data not showing up in Subform

A

Ayo

I have amain form with two subforms embeded into two TabCtl Pages. I have 3
Tables: tblSiteList, tblMaterialsDatabase and tblMilestones. They are the
following fields in common so I used them as the Link Fields, Master & Child.
tblSiteList:Site Id, Market, NLP
tblMaterialsDatabase:Site ID, Market, NLP
tblMilestones:Candidate Id,Market Name,UMTS NLP Status

tblSiteList has a One-to-Many relationship with the other two tables.
Currently I only have one form with tblSiteList as the Record Source. In the
form there is a TabCtl with 2 Pages named Materials and Milestones
respectively.
In each page there is a subform "tblMilestones subform" on Milestones and
"tblMaterialsDatabase subform" on Materials. The goal is to have the subform
display data based on Site Id, Market, NLP fields on the mainform. Also the
Materials tab also have a combobox called cmbShoppingCart which is used in
conjunction withthe Site Id, Market, NLP fields to narrow down the result in
the tblMilestones subform." But for some reason I am not getting anything in
my subforms and I can't figure it out.
I need help. I have been struggling with this now for about 4 days with no
results. Please help.

Private Sub psBuildComboSQL()
Dim strSQL As String
strSQL = "SELECT DISTINCT [Shopping Cart] " & _
"FROM tblMaterialsDatabase " & _
"WHERE ([Site ID] = """ & Me.cmbSiteId & """) AND " & _
"([Market] = """ & Me.Market & """) AND " & _
"([NLP] = """ & Me.NLP & """) " & _
"ORDER BY [Shopping Cart]"
Me.cmbShoppingCart.RowSource = strSQL
Me.cmbShoppingCart = Null
Me.cmbShoppingCart.Requery
End Sub

Private Sub psBuildMilestoneSubformSQL()
Dim strSubformSQL As String, siteID As String
strSubformSQL = "SELECT * " & _
"FROM tblMilestones " & _
"WHERE ([Candidate Id] = "" & Me.cmbSiteId & "") AND " & _
"([Market Name] = "" & Me.Market & "") AND " & _
"([UMTS NLP Status] = "" & Me.NLP & "")"
Me.tblMilestones_subform.Form.RecordSource = strSubformSQL
End Sub

Private Sub psBuildSubformSQL()
Dim strSubformSQL As String
strSubformSQL = "SELECT * " & _
"FROM tblMaterialsDatabase " & _
"WHERE ([Site ID] = """ & Me.cmbSiteId & """) AND " & _
"([Market] = """ & Me.Market & """) AND " & _
"([NLP] = """ & Me.NLP & """) AND " & _
"([Shopping Cart] = """ & Me.cmbShoppingCart & """)"
Me.tblMaterialsDatabase_subform.Form.RecordSource = strSubformSQL
End Sub
 

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

Top