Note:
Code:
Dim Warehouse1, StrWarehouse1 As String
Dim Warehouse2,StrWarehouse2 As String
Variables "StrWarehouse1" and "StrWarehouse2" are declared as type String
Variables "Warehouse1" and "Warehouse2" are declared as type Variant.
You MUST Explicitly declare variable types, otherwise they default to type Variant.
Code:
Dim Warehouse1 As String, StrWarehouse1 As String
Dim Warehouse2 As String, StrWarehouse2 As String
------------------------------------------------------------------------------------------
Code:
StrWarehouse1 = DCount("[Name]", "[Work_Team]", "[Department]= 'Warehouse' And [ProductionLine]= '" & Me.Line_Production & "'")
"Name" is a reserved word in Access and shouldn't be used as object names. Plus, it is not very descriptive - NAME of what??? Your dog's name? Street name you live on?