M
mabedin via AccessMonster.com
Hi,
I have seen serveral filtered form and logon form. I have the same problem as
well. I am trying ot filter a Contact form when a user logon on to the form.
I have accomplished the logon part. But I am unable to filter the
"frmContact" Form.
frmLogon
--------------
cboEmployee (combo box) - this drop downs Agent's First Name and Last Name in
text format
txtPassword (textbox)
Go button
Once the password and user id is correct and verified, I have coded
DoCmd.OpenForm "Contacts"
frmContact
----------------
frmContact On Open Property code is:
Private Sub Form_Open(Cancel As Integer)
If Form_frmLogon!cboEmployee = "FirstName LastName" Then
' *************************************************
' I can use
' If Form_frmLogon!cboEmployee = 13 Then
' 13 is the EmployeeID
' *************************************************
Form.FilterOn = False
AgentID.Enabled = True
AgentID.Locked = False
AgentID.Visible = True
cboLeadStatusID.Visible = True
cmdImportLeads.Visible = True
cmdAddViewAgentsInformation.Visible = True
Else
Form.FilterOn = True
AgentID.Enabled = False
AgentID.Locked = True
AgentID.Visible = True
Notes.Enabled = False
Notes.Locked = True
'Notes.BackStyle = Transparent
cmdViewReports.Visible = False
Label50.Visible = False
End If
End Sub
Please help. Thanks in advance.
I have seen serveral filtered form and logon form. I have the same problem as
well. I am trying ot filter a Contact form when a user logon on to the form.
I have accomplished the logon part. But I am unable to filter the
"frmContact" Form.
frmLogon
--------------
cboEmployee (combo box) - this drop downs Agent's First Name and Last Name in
text format
txtPassword (textbox)
Go button
Once the password and user id is correct and verified, I have coded
DoCmd.OpenForm "Contacts"
frmContact
----------------
frmContact On Open Property code is:
Private Sub Form_Open(Cancel As Integer)
If Form_frmLogon!cboEmployee = "FirstName LastName" Then
' *************************************************
' I can use
' If Form_frmLogon!cboEmployee = 13 Then
' 13 is the EmployeeID
' *************************************************
Form.FilterOn = False
AgentID.Enabled = True
AgentID.Locked = False
AgentID.Visible = True
cboLeadStatusID.Visible = True
cmdImportLeads.Visible = True
cmdAddViewAgentsInformation.Visible = True
Else
Form.FilterOn = True
AgentID.Enabled = False
AgentID.Locked = True
AgentID.Visible = True
Notes.Enabled = False
Notes.Locked = True
'Notes.BackStyle = Transparent
cmdViewReports.Visible = False
Label50.Visible = False
End If
End Sub
Please help. Thanks in advance.