Private Sub cmdLogin_Click()
Dim X As String
DoCmd.OpenForm "FrmLoginQry", , , , , acHidden
DoCmd.OpenForm "FrmUserAllocation", acNormal, , , , acHidden
If Forms!FrmLoginQry!txtPassword <> "" Then
DoCmd.Close acForm, "FrmLogon"
' the custom form details are copied from the opened query to the allocation form where it is used
[Forms]![frmuserallocation]![CustomFormName] = [Forms]![FrmLoginQry]![CustomFormName]
DoCmd.Close acForm, "FrmLoginQry"
x= [Forms]![frmUserAllocation]![CustomFormName]
DoCmd.OpenForm X
Else
DoCmd.Close acForm, "FrmLoginQry"
DoCmd.OpenForm "Frmlogon"
DoCmd.Close acForm, "FrmUserAllocation"
End If
End Sub