Results 1 to 5 of 5
  1. #1
    Join Date
    Jun 2012
    Posts
    7

    Unanswered: Check Box Insert Text into Field

    Hi,

    I am trying to have my DB select a Dropdown option from a combo box in a table when I select a Y/N check box.

    Im not sure if it is possible to update a combo box from a Y/N check box, if it is not I would like to insert specified text into a note field.

    Currently here is what I have:

    Incoming (Y/N check box)
    Transaction Type (Combo box, TEXT)
    Notes (Memo)

    What I tried was (combo box)

    If Me.[Incoming] = -1 Then
    Me.[Transaction Type] = "Traded Incoming" <------This is an option from the drop down.

    *This was for the combo box

    What I tried (Text Field)

    If Me.[Incoming] = -1 Then
    Me.[Notes:] = "Traded Incoming" <-----This would be "canned" text insert

    Im pretty sure I am missing some quotes or something.

    Thanks

  2. #2
    Join Date
    Mar 2009
    Location
    Dorset
    Posts
    119
    What is happening - any errors?

    Does the combo box have andy hidden columns e.g. if the first column was the ID and the second column is the description ("Traded Incoming") you would need to send the ID to it and not the description.
    Regards
    JD

    Software-Matters

  3. #3
    Join Date
    Jun 2012
    Posts
    7
    When I check the (Y/N) check box both for Y and N I get the following error (and this is if I try to do it in combo or memo field)

    The Expression After Update you entered as the event property setting produced the following error: A problem occurred while Micorsoft Access was communicating with the OEL server OLE or ActiveX Control.

    EDIT: The above error, is related to somehting else. I messed up the form somehow. The Real Error I am getting is

    Run Time Error 2465

    Microsoft Access Cant fint the field '|1' referred to in your expression.

    Here is the VB code I have. See bold, the first event works good.

    Private Sub Traded_Incoming_AfterUpdate()
    If Me.[Traded Incoming] = -1 Then
    Me.[Player Active] = -1

    Else
    Me.[Player Active] = 0
    End If

    If Me.[Trade Incoming] = -1 Then
    Me.[Notes:] = "TRADE RECEIVE"
    End If


    End Sub
    Last edited by aharper; 06-19-12 at 13:46. Reason: wrong error

  4. #4
    Join Date
    Mar 2009
    Location
    Dorset
    Posts
    119
    The error seems obvious - it can't find a field - so are you sure your field names are correct?
    If they are then which line does it error on from the following code:
    Also, have you tried putting a debug stop on and stepping through it?

    Private Sub Traded_Incoming_AfterUpdate()
    If Me.[Traded Incoming] = -1 Then
    Me.[Player Active] = -1

    Else
    Me.[Player Active] = 0
    End If
    Regards
    JD

    Software-Matters

  5. #5
    Join Date
    Jun 2005
    Location
    Richmond, Virginia USA
    Posts
    2,763
    Provided Answers: 19
    Assuming that Traded_Incoming and Player Active are the actual names of Controls on your Form, you have to consider the possibility that your Traded_Incoming Checkbox is corrupt. Controls can and do become corrupted. Try deleting it and then re-creating it.

    Linq ;0)>
    Hope this helps!

    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

Posting Permissions

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