February 20th, 2013, 02:36 PM
Join Date: Feb 2013
Time spent in forums: 1 h 5 m 35 sec
Reputation Power: 0
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.
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
If InStr(stLinkCriteria, Str2) > 0 Then
DoCmd.OpenForm stDocNameF, , , stLinkCriteria
MsgBox "The directory already exist!", vbCritical