Page 1 of 3 123 LastLast
Results 1 to 15 of 35
  1. #1
    LesleaOH is offline Novice
    Windows XP Access 2007
    Join Date
    Sep 2009
    Posts
    19

    Synchronized Combo Boxes

    I have a database set up for time sheets and need help creating some combo boxes that are synchronized based on the information in the first box, then the second box which populates the third box. The joint table is called Timesheet. The first combo box (cboStorm) would pull StormID from Storm Names table. The second box (cboPW) would pull PWNumberID from PW Codes table. (There is a column in PW Codes called StormID to tie them together) The third combo box (cboCref) would pull CPSBRefID from CPSBRef table. (There is a column in CPSBRef called PWNumberID to tie them together)



    Can someone please help me out? I've been able to get the first two to synchronize but I kept getting a parameter error. I tried to use the VBA method off of the Microsoft Access site with the following code as an After Update Event for cboStorm.

    Option Compare Database

    Private Sub cboStorm_AfterUpdate()
    Me.cboPW.RowSource = "SELECT PWNumberID FROM" & _
    " PW Codes WHERE StormID = " & Me.cboStorm & _
    " ORDER BY PWNumberID"
    Me.cboPW = Me.cboPW.ItemData(0)

    End Sub

    I can upload a test database also to my website if someone needs to look at it/can help. Thanks!

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Maybe this link will help.

  3. #3
    LesleaOH is offline Novice
    Windows XP Access 2007
    Join Date
    Sep 2009
    Posts
    19
    I did find that one when I searched earlier but it only has one table where I am pulling from different tables. I did try it but couldn't figure it out.

  4. #4
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    You can zip the file and post it here if you like. Scroll down to Manage Attachments when posting.

  5. #5
    LesleaOH is offline Novice
    Windows XP Access 2007
    Join Date
    Sep 2009
    Posts
    19
    Here is the file. I was attempting the combo boxes on Form1

  6. #6
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Go ahead and edit the post and upload the file this time.

  7. #7
    LesleaOH is offline Novice
    Windows XP Access 2007
    Join Date
    Sep 2009
    Posts
    19
    Oh hush :-P I was in the process of doing that once I realized it wasn't there :-)

  8. #8
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    See if this one works for you. Strings need to be enclosed with single or double quotes and names with embedded spaces need to be enclosed with brackets.

  9. #9
    LesleaOH is offline Novice
    Windows XP Access 2007
    Join Date
    Sep 2009
    Posts
    19
    Oh wow, thanks a bunch!! I'll play with it but it looks like exactly what I needed.

  10. #10
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Glad I could help. Are you ready to use the Solved thread tool yet?

  11. #11
    LesleaOH is offline Novice
    Windows XP Access 2007
    Join Date
    Sep 2009
    Posts
    19
    As soon as I get it worked into my timesheet form with no problems :-) I have a wee bug to fix first

  12. #12
    LesleaOH is offline Novice
    Windows XP Access 2007
    Join Date
    Sep 2009
    Posts
    19

    Talking

    OK, it all works so I can do the Solved button now. Thank you so much for your help

  13. #13
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    You're very welcome.

  14. #14
    LesleaOH is offline Novice
    Windows XP Access 2007
    Join Date
    Sep 2009
    Posts
    19
    I have another question about the form. I have it integrated and it works just fine entering the information. The only problem is after I enter the information, then go to the next record to enter new info, the choice from the first box, cbostorm is defaulting to the same value from the previous record. Any ideas on how I can make it go back to showing blank?

  15. #15
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    You can clear it in the Current Event of the form is Me.NewRecord is true.

Page 1 of 3 123 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 2
    Last Post: 08-24-2009, 10:36 AM
  2. Cascading Combo Boxes
    By gjw1012 in forum Access
    Replies: 1
    Last Post: 07-25-2009, 04:59 PM
  3. combo boxes
    By googenfrog in forum Forms
    Replies: 3
    Last Post: 07-03-2009, 05:41 PM
  4. combo boxes
    By labrams in forum Forms
    Replies: 0
    Last Post: 04-20-2006, 09:28 AM
  5. Combo Boxes
    By Mxcsquared in forum Forms
    Replies: 0
    Last Post: 01-19-2006, 04:59 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