Results 1 to 2 of 2

Thread: Where Condition

  1. #1
    Join Date
    Nov 2012
    Posts
    2

    Unanswered: Where Condition

    Hi
    Can someone please tell me what I have wrong in this line of code?


    Code:
     With CodeContextObject
            DoCmd****nCommand acCmdSaveRecord
            DoCmd****nCommand acCmdRefresh
            DoCmd.OpenForm "FMultiName", acNormal, "", "[FName]=" & .FName & "[LName]=" & .LName, , acDialog
        End With

  2. #2
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    can someone please tell us
    what is happening that shouldn't
    OR
    what isn't happening that should

    as a design stylistic I'm surprised to see a form being opened in a loop
    there is no indication whether the loop is within a code block, so we dont' know if the .FName & .LName are correctly populated
    assumign the FNAME and LNAMe are string values then they should be encapsulated by quote marks
    "FName = '" & .FName & "' AND Lname = '" & .LName & "'"
    or
    "FName = " & chr$(34) & .FName & & chr$(34) " AND Lname = " & chr$(34) & .LName & chr$(34)
    I'd rather be riding on the Tiger 800 or the Norton

Posting Permissions

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