Hi all,
The code snippet below is the last section of an If..Then. The code preceeding checks to be certain combo boxes have a selection. Once that is satisfied, I want the record selected in the list box to be evaluated as to whether the 12th column of information is empty or not. If the column data is not blank (the column contains text) then display a message box that says data exists and click OK to open a change form. If the column is empty/blank/no text exists, then open an add form. I'm trying to code for spaces that may be present and would be considered blanks.
Thanks in advance for your assistance.
Here is the code I've got so far.
ElseIf Me!lstSelectSection.Column(12) <> " " Or Not IsEmpty(Me!lstSelectSection.Column(12)) Then
If MsgBox("This section has Special Narrative." _
& Chr(13) & Chr(10) _
& "Press 'OK' to open the Change Narrative screen.", _
vbOKOnly, "Special Narrative Redirect.") = _
vbOK Then
Dim strDocName As String
Dim strLinkCriteria As String
strDocName = "frmChngSpeNarr"
strLinkCriteria = "[Sect]=" & "'" & Me![Sect] & "'"
DoCmd.OpenForm strDocName, , , strLinkCriteria
End If
Else
strDocName = "frmAddSpeNarr"
strLinkCriteria = "[Sect]=" & "'" & Me![Sect] & "'"
DoCmd.OpenForm strDocName, , , strLinkCriteria
End If
The code snippet below is the last section of an If..Then. The code preceeding checks to be certain combo boxes have a selection. Once that is satisfied, I want the record selected in the list box to be evaluated as to whether the 12th column of information is empty or not. If the column data is not blank (the column contains text) then display a message box that says data exists and click OK to open a change form. If the column is empty/blank/no text exists, then open an add form. I'm trying to code for spaces that may be present and would be considered blanks.
Thanks in advance for your assistance.
Here is the code I've got so far.
ElseIf Me!lstSelectSection.Column(12) <> " " Or Not IsEmpty(Me!lstSelectSection.Column(12)) Then
If MsgBox("This section has Special Narrative." _
& Chr(13) & Chr(10) _
& "Press 'OK' to open the Change Narrative screen.", _
vbOKOnly, "Special Narrative Redirect.") = _
vbOK Then
Dim strDocName As String
Dim strLinkCriteria As String
strDocName = "frmChngSpeNarr"
strLinkCriteria = "[Sect]=" & "'" & Me![Sect] & "'"
DoCmd.OpenForm strDocName, , , strLinkCriteria
End If
Else
strDocName = "frmAddSpeNarr"
strLinkCriteria = "[Sect]=" & "'" & Me![Sect] & "'"
DoCmd.OpenForm strDocName, , , strLinkCriteria
End If