-
Hi :) I’m trying to make a function that sees if there is a record in
Adoski Ware The FamilyID = AdoFamily.Recordset(“FamilyID”)
So this is what I’ve tried:
Private Function ITASIF() As Boolean
With AdoSki.Recordset
.MoveFirst
.Find " familyID = " & AdoFamily.Recordset("FamilyID"), 1
If .EOF = True Then ITASIF = False Else ITASIF = True
End With
End Function
and it Gives ITASIF = false the first time it gets run
This is the What the data base Looks like
+Properties
–Family
| |–Fields
| |–FamilyID
| |–Last Name
| |–First Name
| |–Street Address
| |–City
| |–State
| |–Zip
| |–Phone Number
| \–E Mail
|
–Skiers
|–Fields
|–FamilyID
|–First Name
|–Lift
|–Lesson
|–Rentals
|–Price
\–Payed
Thanks a lot. :) :cool: :)
Please Help. :) :) :)
[This message has been edited by Stepeh (edited 02-20-2000).]
-
I think your problem is this: The record may not be found because you are skipping over it. E.g.
Say the FamilyID in the adofamily recordset is 123. You do a movefirst which makes the first record the currect record (in adoski). This record may have FamilyID = 123. Then in the .Find line, the ",1" at the end specifies to skip one record before doing the search, so the first record is skipped and thus a match is not found.
I suggest:
1) change the ",1" to ",0" (or leave it out altogether as the default is 0) so that the first record is not skipped.
hopefully this was your problem although it is a bit of a longshot.
-
i just noticed one more thing, if FamilyID is a string it needs to be delimited with single quotes, so:
.Find " familyID = " & AdoFamily.Recordset("FamilyID")
would become
.Find " familyID = '" & AdoFamily.Recordset("FamilyID") & "'"
-
Thanks funkyd77 that fixed it :) :) :) :)
:cool: :cool:Junior Members Rock :cool: :cool: