Results 1 to 4 of 4
  1. #1
    Join Date
    Jun 2012
    Posts
    3

    Unanswered: slightly desperate question

    I just inherited an Access 2007 database that was done in an earlier version of Access, and have to get it modified before tomorrow. I haven't worked with VB or Access for years, so I'm banging my head at the moment.


    There is a table called "participants."

    There is a field within the table called "minutes."

    On the entry form, there is text box called "minutesCurrent" that displays the value in the "minutes" field.

    There is another text box on the entry form called "newMinutes."

    There is a Command Button with a plus symbol in it that calls an event procedure. In the VB code it looks like this:

    Private Sub addNewMinutes_Click()
    DoCmd.SetWarnings False
    [minutesCurrent] = [minutesCurrent] + [newMinutes]
    [newMinutes] = 0
    DoCmd.SetWarnings True
    End Sub

    In theory, clicking on the command button should take whatever value has been put into newMinutes, add it to minutesCurrent (and refresh that text box), and clear out newMinutes. It doesn't do anything, of course.

    If anyone could point me in the general direction of what the VB should be doing, I would appreciate it.

  2. #2
    Join Date
    Mar 2009
    Posts
    5,442
    Provided Answers: 14
    I would change the procedure and see what happens:
    Code:
    Private Sub addNewMinutes_Click()
    
        If Nz(Me.newMinutes.Value, 0) <> 0 Then
            Me.minutesCurrent.Value = Nz(Me.minutesCurrent.Value, 0) + Me.newMinutes.Value
            Me.newMinutes.Value = 0
        End If
        
    End Sub
    Have a nice day!

  3. #3
    Join Date
    Jun 2012
    Posts
    3
    Unfortunately, that doesn't do anything, either.

    This is on a Windows 7 computer - does that have anything to do with it? I have never encountered this type of issue on something so basic in the past.

    I don't see any settings in the "minutes" field in the table or the text box on the entry form that control whether it can be updated or not.

  4. #4
    Join Date
    Jun 2012
    Posts
    3
    Never mind, it turned out to be a "Trusted Location" issue. Thanks for the help!

Posting Permissions

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