I am running a test and get "MS Access can't find the field '|' referenced to in your expression" on the Bold
It works fine in a query.
If I change it to DLookup("[unique_id]","[Table1]") it will pass to the next step. what is wrong with:
"[parent_equipment_item_id]='" &[unique_id] & "' And [Row Type]='MEQUIP'"
Code:
Private Sub Command0_Click()
Dim BaseWChild As Integer, BaseWOChild As Integer
Dim BaseEquip As String
BaseEquip = DLookup("[unique_id]","[Table1]", "[parent_equipment_item_id]='" &[unique_id] & "' And [Row Type]='MEQUIP'")
If BaseEquip<> "" Then
BaseWChild= DCount("[unique_id]", "[Table1]", "[parent_equipment_item_id]='"& [platform_id] & "' AND [Equip LIN]='" & [Equip LIN]& "'AND ID<" & [ID] + 1)
ElseIfBaseEquip = "" Then
BaseWOChild= DCount("[unique_id]", "[Table1]","[parent_equipment_item_id]='" & [platform_id] & "' AND[Equip LIN]='" & [Equip LIN] & "'AND ID<" & [ID]+ 1)
End If
End Sub