Results 1 to 5 of 5
  1. #1
    JQuinnC is offline Novice
    Windows 10 Access 2016
    Join Date
    Apr 2016
    Posts
    11

    Use combo box to change subform

    Access is sentient and annoying me on purpose.

    Ok, I'm trying to build a form with a combo box and a button that will change the data in a subform on that form.

    Basically, a dropdown box of customer names that will populate the full list of fields when I click the button.

    I can make the button take me to a new form, but I have no idea how to change the target to the subform. How do I do this?

    I'm pretty beginner at this and it's my first database.

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,525
    Usu, the combo changes the master form,the the subForm changes off that.
    in the combo AFTERUPDATE event, set the filter..
    me.filter= "[clientID]=" & cboBox
    me.filterOn = true.

    but for subForm,you have to its filter...
    me.subform.form.filter= ....

  3. #3
    JQuinnC is offline Novice
    Windows 10 Access 2016
    Join Date
    Apr 2016
    Posts
    11
    Sorry, like I said, beginner.

    I'm not quite sure what you told me to do.

    My current code for the button is:
    Click image for larger version. 

Name:	macro code.PNG 
Views:	16 
Size:	9.8 KB 
ID:	24247

    When I click the "View Client" button, the "CurrentClientsView" tab updates, but the subform does not.

    Click image for larger version. 

Name:	View.PNG 
Views:	16 
Size:	14.8 KB 
ID:	24248

    Where do I put
    me.filterOn = true.

    but for subForm,you have to its filter...
    me.subform.form.filter= ....
    ?

  4. #4
    vicsaccess's Avatar
    vicsaccess is offline Competent Performer
    Windows 8 Access 2013
    Join Date
    Apr 2015
    Posts
    451
    I haven't used macros in a while so I'm out of practice but that where clause looks wrong. have you tried a google or YouTube search? there's some pretty good tutorials out there dealing with about anything to do with access. here's one i found that might solve your problem
    https://www.youtube.com/watch?v=L8nEFLVMQE8

  5. #5
    JQuinnC is offline Novice
    Windows 10 Access 2016
    Join Date
    Apr 2016
    Posts
    11
    Not what I was looking to do originally, but it'll work. Thanks!

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

Similar Threads

  1. Replies: 4
    Last Post: 03-06-2015, 12:38 AM
  2. change subform completely based on combo box
    By benjammin in forum Forms
    Replies: 3
    Last Post: 03-13-2013, 11:16 AM
  3. Replies: 3
    Last Post: 12-11-2012, 09:12 AM
  4. Replies: 5
    Last Post: 01-02-2011, 10:09 AM
  5. Updating subform based on combo box change
    By kev921hs in forum Forms
    Replies: 3
    Last Post: 04-01-2010, 08:43 AM

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