Results 1 to 3 of 3
  1. #1
    Join Date
    Jul 2010
    Location
    Fire Island Pines, NY
    Posts
    513

    assignig a choice to a frame's option buttons

    i have an frame with 3 option buttons. sometimes a record may not yet have a value for the field attached to the frame, in which case i want to assign the value 3 (the default value of a new record may be different, but of an existing record, if nothing is yet entered, 3 would be the correct choice.)



    so i put in this line of code. the second half of it does return the correct value (3) (when the field value is null), but it does not assign the value to the frame; button 3 is not choosen, and the buttons remain greyed out (as if the value was null)

    Code:
                    .frmSinkSource.Value = Nz(DLookup("[SinkSource]", "tbeFixtureTypeDetails"), 3)
    hmmmm?
    with thanks in advance,
    mark

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,550
    if the record is there but the field already is null, then the frame wont give a value.
    youd have to physically set the option thru the form, or refresh the form if done behind the form in a query.

  3. #3
    ssanfu is offline Master of Nothing
    Windows 7 32bit Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    In my tests, the option button gets selected/highlighted.

    I created a table "tbeFixtureTypeDetails" with a field "[SinkSource]". The table has one record - I set the field to 2 and ran the code. 2 was returned and the correct button was "selected".
    Do you have the option frame bound to a field?

    I then deleted the value and ran the code. 3 was entered and the correct button was again "selected".


    BTW, you do not have criteria specified for the DLookup. From Help:
    The DLookup function returns a single field value based on the information specified in criteria. Although criteria is an optional argument, if you don't supply a value for criteria, the DLookup function returns a random value in the domain.


    You could post a copy of your dB for analysis........

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

Similar Threads

  1. Using a two choice option on a table
    By Lou_Reed in forum Access
    Replies: 2
    Last Post: 12-06-2016, 07:01 PM
  2. How to hide the frame of a option group
    By Bradex in forum Forms
    Replies: 2
    Last Post: 04-29-2016, 06:55 AM
  3. assigning the inital value to an option frame control
    By markjkubicki in forum Programming
    Replies: 6
    Last Post: 08-12-2015, 07:06 AM
  4. Adding option within a frame
    By crowegreg in forum Forms
    Replies: 1
    Last Post: 09-11-2012, 01:51 PM
  5. Replies: 6
    Last Post: 12-30-2011, 08:09 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