Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2010
    Posts
    39

    Unanswered: Openform Action Cancelled - Runtime Error 2501

    Hey.. anyone point me as to why? Code that's being run in macro is:

    Function OpenFormWithInput()
    Dim Msg As String
    Dim Title As String
    Dim Defvalue As String
    Dim Answer As String

    Msg = "ENTER RCID OF QUERIED FLAG"
    Title = "OPEN FORM"
    Defvalue = "0"
    Answer = InputBox(Msg, Title, Defvalue)
    If Answer <> "" Then
    DoCmd.OpenForm "QUERIES", , , "[RCID]='" & Answer & "' "
    Else
    DoCmd.OpenForm "QUERIES"
    End If
    End Function

  2. #2
    Join Date
    Jan 2010
    Posts
    39
    All Fixed and working:

    Previous

    DoCmd.OpenForm "QUERIES", , , "[RCID]='" & Answer & "' "

    Fix

    DoCmd.OpenForm "QUERIES", , , "[RCID]=" & Answer & " "

Posting Permissions

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