Look at the differences between the two form:
Code:
Form = EngineerForm
combo box name = "Site"
Control source = "SiteName" (text type field)
Row Source = "SELECT Sites.SiteName FROM Sites; "
Bound column = 1
Column count = 1
Column widths =
combo box name = "Combo33" (FactoryName)
Control source = FactoryName (text type field)
Row Source = SELECT Factories.FactoryName, Factories.SiteName FROM Factories WHERE (((Factories.SiteName)=[Forms]![EngineerForm]![Site]));
Bound column = 1
Column count = 1
Column widths =
------------------------------------
Form = MBRForm
combo box name = "Site"
Control source = SiteName (text type field)
Row Source = SELECT [Sites].[SiteID], [Sites].[SiteName] FROM Sites;
Bound column = 1
Column count = 2
Column widths = 0";1"
combo box "Combo186" (FactoryName)
Control source = Unbound
Row Source = SELECT Factories.FactoryID, Factories.FactoryName, Factories.SiteName FROM Factories WHERE (((Factories.SiteName)=[Forms]![MBRForm]![Site]));
Bound column = 1
Column count = 2
Column widths = 0";1"
For form MBRForm,
the combo box "Site" bound column is "SiteID", a Long Integer.
for "Combo186" (FactoryName), in the WHERE clause, you are comparing "Factories.SiteName" (a text field) to "[Forms]![MBRForm]![Site]", a Long Integer.
The recordset will always be 0 records.
In combo box "Site", your control source is a text type field (SiteName), but the bound column is "SiteID", a Long Integer....?????
In combo box "Combo186" (FactoryName), your control source is UNBOUND; if it was bound to text type field "FactoryName", you would be storing "FactoryID" ( a number) in a text type field.
Also, you should change the after update code in EngineerForm to
Code:
Private Sub Site_AfterUpdate()
Me.Combo33.Requery
Me.Combo33 = Empty
End Sub
and for MBRForm
Code:
Private Sub Site_AfterUpdate()
Me.Combo186.Requery
Me.Combo186 = Empty
End Sub
otherwise you could end up with invalid factory names for a Sitename.