Results 1 to 4 of 4
  1. #1
    tmcrouse is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Apr 2009
    Posts
    169

    Onclick event

    I have a form and one of the list boxes looks at what is in a table. Such as MS Certified, Excel Certified, etc. It is a skills table in the database. Each skill has a number of questions that have to be completed assigned. Such as Ms Certified will have 5 and Excel Certified will have 7. What I need to do is in the onclick event when they choose from the combobox, whatever they choose displays the number of questions in this textbox below.



    so the label is skill: the combobox is skill and it looks at a table in my database.

    then the next is:

    label is number of questions in this skill set: the textbox is number of questions and that number of questions is in the skills table in its own column. so I have tried the onclick event and different query strings but nothing works. the only thing I can figure is doing case select and saying if the skill = MS Certified then 5 else if Excel Certified 7...etc...but there are 151 of these and that seems like tons of work and there has to be a way onclick for it to look for an event. run a select query and say hey MS Certified = 5 for number of questions so write the number 5 into the number of questions text box. any help would be appreciated.

  2. #2
    tmcrouse is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Apr 2009
    Posts
    169
    Have tried this:

    private sub skill_click()
    me.textboxnumquestions = me.comboboxskill
    if skill.value = [skillstable].[skillsrequired] then
    textbosnumquestions = [skillstable].[nbrquestions]
    end if
    end sub


    doesn't work. trying to make the combo and text look at the tables and respond correctly

  3. #3
    tmcrouse is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Apr 2009
    Posts
    169
    actually I got it.

    I made my combobox choose all rows in table. My boss had only 1 row choosen. I saw that. Then I changed all the columns to 1";0"; etc. Then in my event I did after update and put in the code:

    private sub skill_afterupdate()
    me!numquestions = me!skill.column(6)
    endsub

  4. #4
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 Access 2007
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Excellent! Are you ready to follow the link in my sig and mark this thread as Solved?

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

Similar Threads

  1. OLEunbound onclick event
    By thangasiva in forum Forms
    Replies: 1
    Last Post: 03-26-2015, 10:55 AM
  2. Clear a Field OnClick
    By eww in forum Forms
    Replies: 3
    Last Post: 08-19-2010, 01:55 PM
  3. OLEunbound onclick event
    By thangasiva in forum Access
    Replies: 1
    Last Post: 06-27-2010, 01:49 PM
  4. Set onclick via VBA
    By Gerry in forum Programming
    Replies: 6
    Last Post: 04-19-2010, 09:23 AM
  5. OnClick event
    By HotTomales in forum Forms
    Replies: 1
    Last Post: 12-24-2009, 08:10 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