Results 1 to 3 of 3
  1. #1
    Norbayah is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Feb 2012
    Posts
    5

    Question Option Buttons & After Update code - Linked

    In my Form of Access 2010, I have bound textboxes named; Current Reference (Text), Date, Amount (Currency), Rev 0 Reference (Text), Rev 0 Date (Date), Rev 0 Amount (Currency), Rev 1 Reference, Rev 1 Date, Rev 1 Amount, Rev 2 Reference, Rev 2 Date, Rev 2 Amount, Rev 3 Reference, Rev 3 Date, Rev 3 Amount, Rev 4 Reference, Rev 4 Date, Rev 4 Amount.

    I also have unbounded option buttons named; R0, R1, R2, R3 & R4 with After Update code which written like the following:
    __________________________________________________ ____________
    Private Sub Option R0_AfterUpdate()
    Me. Rev 0 Reference = Me. Current Reference
    Me. Rev 0 Date = Me. Date
    Me. Rev 0 Amount = Me. Amount
    End Sub
    __________________________________________________ ____________
    Private Sub OptionR1_AfterUpdate()
    Me. Rev 1 Reference = Me. Current Reference
    Me. Rev 1 Date = Me. Date
    Me. Rev 1 Amount = Me. Amount
    End Sub
    __________________________________________________ ____________
    Private Sub OptionR2_AfterUpdate()
    Me. Rev 2 Reference = Me. Current Reference
    Me. Rev 2 Date = Me. Date
    Me. Rev 2 Amount = Me. Amount


    End Sub
    __________________________________________________ ____________

    ETC., ETC.,

    The idea is if I click on 1 of the option buttons, the data from Current Reference, Date, and Amount will be copied to the respective textboxes so that I do not need to type again the same data. While in my report, only the Current Reference, Date, Amount will be shown and the rest are just for recording purposes. This has been achieved successfully.

    The problems are:-
    1. Once I move to next record, the option button which earlier was selected, remain selected. In a case where I need to click on the same button for the current record, the details have been ‘overwrite’ or removed.
    Question: What are the other solutions I could try to make the option button remain unchecked/not selected?

    2. I tried to copy the record to be pasted on a new fresh record. But Microsoft Visual Basic message pop-up showing “Run-time error ‘-2147352567 (80020009)’: Update or CancelUpdate without AddNew or Edit”.
    Question: How to rectify this error?


    Thank you.

  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
    Unless I'm reading this wrong, it sounds like you have a problem with the normalization of the data. Each Reference should be in a separate record. Are they?

  3. #3
    Norbayah is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Feb 2012
    Posts
    5

    Option Buttons & After Update code

    Quote Originally Posted by RuralGuy View Post
    Unless I'm reading this wrong, it sounds like you have a problem with the normalization of the data. Each Reference should be in a separate record. Are they?
    No. The references are in the same record to show the different prices offered on different dates of 1 product.

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

Similar Threads

  1. Working with Radio Buttons and Option Groups
    By queenbee in forum Access
    Replies: 1
    Last Post: 04-29-2011, 02:25 PM
  2. How too use check boxes and option buttons
    By newtoAccess in forum Forms
    Replies: 0
    Last Post: 12-03-2010, 04:41 PM
  3. Option buttons
    By chazcoral2 in forum Forms
    Replies: 11
    Last Post: 09-13-2010, 07:53 AM
  4. option group radio buttons
    By ManC in forum Forms
    Replies: 9
    Last Post: 03-08-2010, 03:46 AM
  5. VBA Code in Access w/ option buttons
    By WebKiid in forum Access
    Replies: 1
    Last Post: 07-16-2009, 12:20 PM

Tags for this Thread

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