Results 1 to 2 of 2
  1. #1
    koper is offline Novice
    Windows XP Access 2000
    Join Date
    Dec 2008
    Location
    Arizona
    Posts
    13

    Simple VBA Question

    I am writing a subroutine using the Event function. I want it to put "insurance" into the field "ReasonNC" and then check the field "ClosedYN." Here is what I wrote:

    Private Sub cmdInsurance_Click()
    On Error GoTo Err_cmdInsurance_Click


    Me.ReasonNC = "Insurance"
    Me.ClosedYN = "-1"
    Exit_cmdInsurance_Click:
    Exit Sub

    Err_cmdInsurance_Click:
    MsgBox Err.Description
    Resume Exit_cmdInsurance_Click

    End Sub



    The Me.ReasonNC = "Insurance" works (when I isolate that command) but I get an error when I try to "check" the field "ClosedYN." What is the correct format to "check" this field? I know it is something simple, but I just can't find it in any of my references.

    Thanks!

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Me.ClosedYN = True
    ...or...
    Me.ClosedYN = -1
    You were trying to put a string in a numeric field.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Simple question about checkboxes
    By George_E in forum Access
    Replies: 9
    Last Post: 12-08-2009, 01:00 AM
  2. Simple question
    By KenM in forum Queries
    Replies: 1
    Last Post: 11-10-2009, 03:32 PM
  3. Simple question?
    By roads.zx in forum Access
    Replies: 0
    Last Post: 10-15-2009, 04:56 PM
  4. Very simple question!
    By fiddley in forum Programming
    Replies: 2
    Last Post: 04-28-2009, 02:16 AM
  5. Should be simple Query Question
    By brj1 in forum Queries
    Replies: 2
    Last Post: 03-04-2006, 01:11 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums