Results 1 to 3 of 3
  1. #1
    Bronze Lounger
    Join Date
    Jan 2001
    Location
    Alzano Lombardo, Italy
    Posts
    1,483
    Thanks
    0
    Thanked 0 Times in 0 Posts

    fill record with data from previous record (2000)

    I'm trying to implement this.
    What baffles me is the For each...Next loop
    <font color=red>For Each C In F
    If FillAllFields Or InStr(FillFields, ";" & (C.Name) & ";") > 0 Then
    C = RS(C.ControlSource)
    End If
    Next</font color=red>
    in the AutoFillNewRecord Function.
    if you omit putting the AutoFillNewRecordFields text box on the Customers form and go to a new record while stepping through code, you can see that
    FillAllFields Or InStr(FillFields, ";" & (C.Name) & ";") equals -1
    so why then does the code continue with the next line
    C = RS(C.ControlSource) ?

  2. #2
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Sint Niklaas, Belgium
    Posts
    2,778
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: fill record with data from previous record (2000)

    If FillAllFields Or InStr(FillFields, ";" & (C.Name) & ";") equals -1
    then it means that one of the conditions is true. If the two conditions where false,
    FillAllFields Or InStr(FillFields, ";" & (C.Name) & ";") would return 0.
    In Access 0 means false, -1 means True
    Francois

  3. #3
    Bronze Lounger
    Join Date
    Jan 2001
    Location
    Alzano Lombardo, Italy
    Posts
    1,483
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: fill record with data from previous record (2000)

    Francois, your post made me realise it's only InStr(FillFields, ";" & (C.Name) & ";") that's tested for being > 0 not FillAllFields Or InStr(FillFields, ";" & (C.Name) & ";")
    <img src=/S/thankyou.gif border=0 alt=thankyou width=40 height=15>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •