I have a form with lists of records. On double click of any of the fields, I want something to do. So, I made a code:
Private Function OpenWeaponSubF() As Boolean
DoCmd.OpenForm "frmWeaponsSubFrm", , , "[EquipID]=" & [EquipID]
End Function
It worked, until I add an if statement. I have 2 forms that I want opened up depending on the [EquipTypeID]. Here's the new code:
Private Function OpenWeaponSubF() As Boolean
If EquipTypeID = 23 Or 24 Then
DoCmd.OpenForm "frmWeaponsOtherReturn", , , "[EquipID]=" & [EquipID]
Else
DoCmd.OpenForm "frmWeaponsSubFrm", , , "[EquipID]=" & [EquipID]
End If
End Function
However, even if the [EquipTypeID] is something other than 23 or 24, it will only open up the [frmWeaponsOtherReturn] form. What am I doing wrong?