
February 20th, 2013, 02:36 PM
|
|
Registered User
|
|
Join Date: Feb 2013
Posts: 2
Time spent in forums: 1 h 5 m 35 sec
Reputation Power: 0
|
|
Hi
I was able to fix some stuff in my script, so is looking correctly for records in two differnet forms, only one thing is still not good that when there is no record to match, is not displaying my message.
Any advice?
#
Dim stDocName As String
Dim stLinkCriteria As String
Dim stDocNameF As String
Dim stDocNameALL As String
Dim CDWM As String
Dim Base As String
Dim i As String
stDocName = "DOC-1"
stDocNameF = "DOC-2"
Str1 = "CDWM"
Str2 = "Base"
stLinkCriteria = "[Document ID]=" & "'" & Me![Document_type] & "'"
If InStr(stLinkCriteria, Str1) > 0 Then
DoCmd.OpenForm stDocName, , , stLinkCriteria
Else
If InStr(stLinkCriteria, Str2) > 0 Then
DoCmd.OpenForm stDocNameF, , , stLinkCriteria
Else
MsgBox "The directory already exist!", vbCritical
End If
End If
#
|