I've a form with some code in the open routine:
basically i have some commands behind 'Box89' that i want hidden if certain text is not present in a text box on the form. This works fine if i'm accessing the form to edit a current record (using this code:
)
whereas if i'm accessing the form to add a new record (using this code
)
it does not hide the box (box89)despite the text box meeting the relevant criteria.
Can anbody help?
it doesn't work
Code:
Me.Box89.Visible = True
Forms![Referrals Edit]![ReferralType].SetFocus
If Me.ReferralType.Text = "Premier Service Managers" Or Me.ReferralType.Text = "FPM" Or Me.ReferralType.Text = "AFSM" Or Me.ReferralType.Text = "Financial Planning Direct" Then
Me.Box89.Visible = False
Else: Me.Box89.Visible = True
End If
basically i have some commands behind 'Box89' that i want hidden if certain text is not present in a text box on the form. This works fine if i'm accessing the form to edit a current record (using this code:
Code:
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Referrals Edit"
stLinkCriteria = "[Beneficiary Name]=" & "'" & Me![search_bene] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria
whereas if i'm accessing the form to add a new record (using this code
Code:
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Frm_InputCaseholder"
DoCmd.OpenForm stDocName, , , stLinkCriteria
DoCmd.GoToRecord , , acNewRec
it does not hide the box (box89)despite the text box meeting the relevant criteria.
Can anbody help?
it doesn't work