Hi all
I have a very simple problem but i am highly confused. firstly, a google web search of "DoCmd.Searchfo rrecord" returns nothing. i've been starting to get suspicious why no one else is interested in this function but me, but here goes:
I am under the impression, that my form, "shift viewer" will goto the first record which has a ShiftID of Me.ShiftID (Me being the subform)
i tried putting a breakpoint, on the 3rd line (DoCmd...) and noticed that the values of sID and ParentsID are both as they should be before i do the 3rd line, but when the 3rd line executes, the form "shift viewer" (very quickly, in like 1/4 of a second) runs through all its records, doesnt find the record where the condition is met ( parameter 4) and returns to the record it was originally on... what am i doing wrong?
thanks in advance
I have a very simple problem but i am highly confused. firstly, a google web search of "DoCmd.Searchfo rrecord" returns nothing. i've been starting to get suspicious why no one else is interested in this function but me, but here goes:
Code:
sID = Me.ShiftID '--- this is the subforms field, ShiftID ParentsID = Me.Parent.ShiftID '---this is shift viewer's field, ShiftID DoCmd.SearchForRecord acDataForm, "shift viewer", , (ParentsID = sID)
i tried putting a breakpoint, on the 3rd line (DoCmd...) and noticed that the values of sID and ParentsID are both as they should be before i do the 3rd line, but when the 3rd line executes, the form "shift viewer" (very quickly, in like 1/4 of a second) runs through all its records, doesnt find the record where the condition is met ( parameter 4) and returns to the record it was originally on... what am i doing wrong?
thanks in advance
Comment