frmLogon is not a child object of frmIndex (even if you are showing it that way), so Forms!frmIndex!frmLogon is not valid.

You need to refer to the form directly, eg:
VB Code:
  1. logonusername = Trim(Forms!frmLogon!txtusername)