Results 1 to 2 of 2
  1. #1
    470vinyl is offline Novice
    Windows 10 Access 2013 64bit
    Join Date
    Feb 2019
    Posts
    1

    Made Field Null if Invisible, Can't Change Value When Made Visible

    I have an option button "BTNPercent" that when enabled, "BoxPercent" is visible with a default value of 30. This works for the first time I hit "BTNPercent"



    When I uncheck it, "BoxPercent" becomes invisible, and the value becomes "null". When it is brought back via "BoxPercent" being enabled, the value is still "null" despite my code to change it. See below. Optnewrev is set to 1(confirmed many times via breakpoint)

    Private Sub BTNPercent_AfterUpdate()

    Select Case Me.BTNPercent.Value
    Case Is = true
    Me.BoxPercent.Visible = True
    IIf optnewrev.Value = 1, Me.BoxPercent.Value = 30, Me.BoxPercent.Visible = True


    Case Else


    Me.BoxPercent.Visible = False
    Me.BoxPercent.Value = null


    End Select


    End Sub

  2. #2
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,801
    Not sure of some things. One thing that would help would be consistent and correct terminology. When in use, option buttons aren't really "enabled". They're selected - or not. More importantly, their value is passed to the frame that contains them, and that value is the "Option Value" property. This may be your biggest issue: if the options were correctly attached to a frame, you get the value from the frame, not the buttons. Then there is "uncheck" as you put it. Check boxes are "checked" and those are a different animal as you probably know.
    EDIT
    Also, when you post code, please use code tags (# on toolbar) with indentation in the code (makes it easier to read and avoids things that the forum sometimes does to code not contained in code tags), but mostly, try to be accurate with the pasted code. What you have posted surely must present an error message (the IIF part)
    Last edited by Micron; 02-11-2019 at 09:10 PM. Reason: added info
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

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

Similar Threads

  1. logged register user who made change
    By ratercero in forum Programming
    Replies: 3
    Last Post: 10-09-2017, 01:03 PM
  2. Message Box if a change has been made
    By hazeleyre23 in forum Access
    Replies: 2
    Last Post: 03-30-2016, 09:57 AM
  3. Replies: 5
    Last Post: 04-16-2015, 12:53 PM
  4. Track who made last change
    By BRZ-Ryan in forum Database Design
    Replies: 9
    Last Post: 01-08-2014, 11:47 AM
  5. Replies: 5
    Last Post: 07-30-2013, 01:12 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