Results 1 to 5 of 5

Thread: Skip and fill

  1. #1
    Join Date
    Apr 2012
    Posts
    3

    Unanswered: Skip and fill

    Hello,

    does anyone know if there is an option in MS Access that will allow one to skip and automatically fill in fields? For example, is there a function that can be programed into a form/table that would allow one to select say "no" for one variable and if "no" is selected for a particular variable it automatically fills in a default value for other variables.

    Thanks!

  2. #2
    Join Date
    Jun 2005
    Location
    Richmond, Virginia USA
    Posts
    2,763
    Provided Answers: 19
    Quote Originally Posted by teleri View Post

    ...allow one to skip and automatically fill in fields?

    ...allow one to select say "no" for one variable and if "no" is selected for a particular variable it automatically fills in a default value for other variables.
    More than 40 members have read your post without responding and I suspect the reason is that no one really has any idea what you're talking about!


    • What in the world does "skip and automatically fill in fields" mean?
    • What does " if "no" is selected for a particular variable it automatically fills in a default value for other variables" mean?
    • Values are assigned to variables, not selected for variables. Are you really talking about variables or are you talking about Controls on a Form / Fields in a Table?

    I'm afraid you're really going to have to do a much better job of explaining your problem, in order for us to be able to help you.

    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

  3. #3
    Join Date
    Apr 2012
    Posts
    3

    Question Response to question

    I think you've almost explained your problem well enough, but you need to explain your form first.

  4. #4
    Join Date
    Apr 2012
    Posts
    3

    Happy to do so

    Basically I want a way to program a trigger so that if one box is checked certain things happen. I'll try to explain, we have forms that we are entering into an Access database that relate to firearms confiscated in a certain county. The first field on the form refers to the original owner of the firearm. If the owner is deceased there are certains fields that can be filled in about the owner's next of kin. Basically I have a combo box that reads:

    Vital Status: (check one)
    Alive = 1
    Deceased = 2
    Unknown = -3

    The next fields are as follows and are relevant only if the original owner is deceased:

    If deceased, another sought possession? (field is called kin): Yes No

    What I want to do is to disable the above field about the owners next of kin if the Vital Status box that is checked is anything but Deceased. Here is what I have and I am not sure why it is not working:

    If Me.vital = 1 Or -3 Then
    Me.kin.Enabled = False

    I have more but this is the basis. It has never worked for me and I am not sure why. I hope that was clear enough, it is difficult to put this sort of things into words on a post.

    Thank you in advance

  5. #5
    Join Date
    Jun 2005
    Location
    Richmond, Virginia USA
    Posts
    2,763
    Provided Answers: 19
    Sorry, I'm still confused by your explanation; probably my fault.

    It sounds as if Vital Status is a Checkbox, but then you talk about Values of 1,2 and -3.

    At any rate, to trigger an event, based on the Value of a given Control, you normally use its AfterUpdate event.

    A general example of this would be
    Code:
    Private Sub TargetControl_AfterUpdate()
     
    If Me.TargetControl = 1 Then 
        'Code here to do something
     Else
        'Code here to undo what was done if not equal to 1
     End If
    
    End Sub
    The Else Clause is there in case the user sets the Value of TargetControl to 1, in this case, and realizes that he made a mistake and corrects it; the previous action can then be corrected as well.

    When the action taken involves Formatting of Controls, such as this case, you have to include the code in the Form_Current event, as well, so that the Formatting will be Record-appropriate, as you move from Record-to-Record.

    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
  •