Page 1 of 2 12 LastLast
Results 1 to 15 of 20
  1. #1
    dino is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jul 2015
    Posts
    9

    what is wrong ?


    Code:
    Private Sub Type_AfterUpdate()
    Dim strSQL As String
    Select Case Me.Type
        Case 1
        strSQL = "select id,functie,regulier from tblfuncties"
        
        Case 2
        strSQL = "select id,functie,evenement from tblfuncties"
        
        Case Else
        End Select
             Me!SubProject_Invullen!Me.txtFunctie
            .RowSource = strSQL
        .ColumnHeads = True
        .Requery
        End With
    End Sub

  2. #2
    orange's Avatar
    orange is online now Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,722
    Seems you are missing a WITH

    see this for Select case syntax and example

    see this for use of With ...End With
    Last edited by orange; 07-28-2015 at 01:26 PM. Reason: spelling and links

  3. #3
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,524
    End Select
    with somthing

  4. #4
    CJ_London is online now VIP
    Windows 8 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,412
    what is the error generated? That must be telling you something. In addition to the missing 'with' and missing 'end select' you are referring to me.type. Type is a reserved word and using it may (or may not) be causing issues

  5. #5
    dino is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jul 2015
    Posts
    9
    With Me!SubProject_Invullen!Me.txtFunctie

    dont cane find vield me.

  6. #6
    CJ_London is online now VIP
    Windows 8 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,412
    try

    Me.SubProject_Invullen.form.txtFunctie

  7. #7
    dino is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jul 2015
    Posts
    9
    and now i cat this
    .RowSource = strSQL
    yelow

  8. #8
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,902
    Maybe:

    Code:
    Private Sub Type_AfterUpdate()
    Dim strSQL As String
    Select Case Me.Type
        Case 1
           strSQL = "select id,functie,regulier from tblfuncties"
        Case 2
           strSQL = "select id,functie,evenement from tblfuncties"
        Case Else
    End Select
    With Me.SubProject_Invullen.Form.txtFunctie
        .RowSource = strSQL
        .ColumnHeads = True
        .Requery
    End With
    End Sub
    txtFunctie is a combobox or listbox?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  9. #9
    orange's Avatar
    orange is online now Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,722
    dino,

    What is this suppose to mean??? Hopefully it isn't meant to be English.
    If English is not your mother tongue, then write the post/question/comment in your own language and use Google translate to put it in English.


    and now i cat this
    .RowSource = strSQL
    yelow

  10. #10
    dino is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jul 2015
    Posts
    9
    And now I get this
    some mistake
    but this rule are yellow ,rowsource=strSQL

  11. #11
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,902
    If you want to provide db for analysis, follow instructions at bottom of my post.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  12. #12
    orange's Avatar
    orange is online now Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,722
    How about posting a copy of your database as June suggested --remove anything confidential/private - then compact and repair - then zip.

    Readers do NOT need all your data. Just enough data to highlight the issue and help readers with context.

  13. #13
    dino is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jul 2015
    Posts
    9
    Click image for larger version. 

Name:	Naamloos.jpg 
Views:	16 
Size:	129.1 KB 
ID:	21427

    the form i use combobox me.type (regelier/evenement) when i choose Regulier and Functie then the uurloon must by Regulier els Evenement.
    tabel

  14. #14
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,902
    Not enough English for me. What is "els"?

    What are regelier, evenement - fields? Regulier and Functie are data?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  15. #15
    dino is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jul 2015
    Posts
    9
    Click image for larger version. 

Name:	Naamloos.jpg 
Views:	13 
Size:	144.5 KB 
ID:	21432
    I hope thisclear some problems


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

Similar Threads

  1. What am I doing wrong?
    By Access_noob_ in forum Programming
    Replies: 3
    Last Post: 11-03-2014, 10:47 AM
  2. VBA gone wrong with an if
    By Ruegen in forum Programming
    Replies: 2
    Last Post: 10-21-2013, 05:38 PM
  3. What's wrong!
    By khalid in forum Programming
    Replies: 15
    Last Post: 06-27-2011, 06:38 AM
  4. What is wrong with this IFF?
    By bburton in forum Reports
    Replies: 2
    Last Post: 03-16-2011, 10:42 AM
  5. What am I doing wrong?
    By brandon in forum Access
    Replies: 2
    Last Post: 08-03-2008, 10:26 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