Results 1 to 5 of 5
  1. #1
    Join Date
    May 2003
    Posts
    25

    Unanswered: which event can i use?

    Hello everyone,

    I am new to Access so this might be a very simple question. I have some code in a button that will update a subform based on a value from another subform. What I am wondering is which event I could use instead of the button so that this will happen automatically when the user is scrolling through the records in the main form using the navigation buttons.

    Thank you.

  2. #2
    Join Date
    Oct 2002
    Location
    Leicester - UK
    Posts
    820
    have you tried

    Private Sub Form_Current()
    Definition of a Beginner, Someone who doesn't know the rules.

    Definition of an Expert, Someone who knows when to ignore the rules.

  3. #3
    Join Date
    May 2003
    Posts
    25
    Originally posted by m.timoney
    have you tried

    Private Sub Form_Current()
    thank you. this works, now when i move through records on my main form, the values in subform2 change depending on those in subform1. now i would also like to change the values in subform2 when moving through records on subform1. but when i try the using the 'current' event on subform1 with the same code, i get an error that says "a problem occurred while access was communicating wtih the OLE server or ActiveX Control." any ideas?

  4. #4
    Join Date
    Oct 2002
    Location
    Leicester - UK
    Posts
    820
    Originally posted by kfenstad
    thank you. this works, now when i move through records on my main form, the values in subform2 change depending on those in subform1. now i would also like to change the values in subform2 when moving through records on subform1. but when i try the using the 'current' event on subform1 with the same code, i get an error that says "a problem occurred while access was communicating wtih the OLE server or ActiveX Control." any ideas?
    not without more information, now for some odd reason i can't download attachments from the forum so send a zipped copy to email removed and i'll take a look at it
    Last edited by m.timoney; 05-13-03 at 14:08.
    Definition of a Beginner, Someone who doesn't know the rules.

    Definition of an Expert, Someone who knows when to ignore the rules.

  5. #5
    Join Date
    Oct 2002
    Location
    Leicester - UK
    Posts
    820
    okay i've fixed the code and sent it back, i don't know where you got it bu tthat is the first time vba has ever reported a lack of memory, it also disable a number of other useful features and i would suggest you never use it again, it causes more problems than it fixes, use the method i've put in the db instead

    the offending code
    Code:
    Private Sub getFacGroups()
      Dim frm1 As Form
      Dim UGsub As Control
      Dim FGsub As Control
    
      Set frm1 = Forms("dbo_users")
      Set UGsub = frm1.userGroupSubform
      Set FGsub = frm1.facGroupSubform
    
      FGsub.Form.FilterOn = False
      If IsNull(UGsub!cboFacGroup.Value) = False Then
        FGsub.Form.Filter = "facilityGroup_id = " & UGsub!cboFacGroup.Value
      Else
        FGsub.Form.Filter = "facilityGroup_id = NULL"
      End If
      FGsub.Form.FilterOn = True
    End Sub
    Definition of a Beginner, Someone who doesn't know the rules.

    Definition of an Expert, Someone who knows when to ignore the rules.

Posting Permissions

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