F
Frank Lara
My name is Frank Lara, I am working to Laredo Independet School and I
working on the special program for nutrition.
I have a problem when I use this procedure.
This procedure search special information in this case search only
Date but I need to search "Date and School Name"
because there have 32 school and all school put information every day and
there have dublicate date. when I shearch in this
case I found this date exist. I need to use 2 criterial and made the Index
"school and Date" but I can made this search.
This is my code. I try to use the "dlookup()" and I have rhe same problem.
and I wrote too.
Seek Method
Set db = DBEngine.Workspaces(0).Databases(0)
Set TB = db.OpenRecordset("schools")
Set tb1 = db.OpenRecordset("BreakLunchSnack")
Set tb2 = db.OpenRecordset("Provisiona")
Me!School = Me![Combo27].Column(0)
tb1.MoveFirst
With tb1
.Index = "Date"
esvar = .Bookmark
.Seek "=", [Date]
If .NoMatch Then
Else
MsgBox ("This Date found and You are need to verification date")
'Date.SetFocus
End If
tb1.Close
End With
Else
End If
Dim icount, ecount
'check to see if this is a duplicate value before updating
icount = DLookup("[School]", "[breaklunchsnack]", "[School] =
Form.[School]") & "," & DLookup("[date]", "[breaklunchsnack]", "[date] =
Form.[date]")
ecount = Me!School & "," & Me!Date
MsgBox (Forms!breaklunchsnack!School)
MsgBox ("yo soy " + icount)
MsgBox ("yo soy ecount " + ecount)
MsgBox (RecNum)
If icount = ecount Then
' this item has already been selected
MsgBox "You have already selected this item."
Cancel = True
Undo
Else
msgBox "the school and date Not Exist"
End If
working on the special program for nutrition.
I have a problem when I use this procedure.
This procedure search special information in this case search only
Date but I need to search "Date and School Name"
because there have 32 school and all school put information every day and
there have dublicate date. when I shearch in this
case I found this date exist. I need to use 2 criterial and made the Index
"school and Date" but I can made this search.
This is my code. I try to use the "dlookup()" and I have rhe same problem.
and I wrote too.
Seek Method
Set db = DBEngine.Workspaces(0).Databases(0)
Set TB = db.OpenRecordset("schools")
Set tb1 = db.OpenRecordset("BreakLunchSnack")
Set tb2 = db.OpenRecordset("Provisiona")
Me!School = Me![Combo27].Column(0)
tb1.MoveFirst
With tb1
.Index = "Date"
esvar = .Bookmark
.Seek "=", [Date]
If .NoMatch Then
Else
MsgBox ("This Date found and You are need to verification date")
'Date.SetFocus
End If
tb1.Close
End With
Else
End If
dlookup------------------------
Dim icount, ecount
'check to see if this is a duplicate value before updating
icount = DLookup("[School]", "[breaklunchsnack]", "[School] =
Form.[School]") & "," & DLookup("[date]", "[breaklunchsnack]", "[date] =
Form.[date]")
ecount = Me!School & "," & Me!Date
MsgBox (Forms!breaklunchsnack!School)
MsgBox ("yo soy " + icount)
MsgBox ("yo soy ecount " + ecount)
MsgBox (RecNum)
If icount = ecount Then
' this item has already been selected
MsgBox "You have already selected this item."
Cancel = True
Undo
Else
msgBox "the school and date Not Exist"
End If