Results 1 to 2 of 2
  1. #1
    Dinoshop is offline Novice
    Windows 7 32bit Access 2013
    Join Date
    Dec 2013
    Posts
    1

    what is wrong

    code<>Private Sub Combo13_AfterUpdate()

    Me.ProjectNaam = DLookup("[projectId]", "[tblprojecten]", "AText='" & Me.ProjectNaam & "'")
    Me.ProjectNaam = Me.Combo13.Column(1)

    Dim rs As DAO.Recordset
    ssql = "SELECT Id FROM Table1 WHERE AText ='" & Me.ProjectNaam & "'"


    Set rs = CurrentDb.OpenRecordset(ssql)
    Me.ProjectNaam = rs!ProjectID
    End Subcode</>

    in the for a have vield name Projectnaam
    and vield whit name combo13
    the search is in the combo13 en vield vilt whit this date.
    but i dont work
    what is wrong?

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,521
    You assigned the field projectnaam w Dlookup ( Me.ProjectNaam = DLookup)
    then you erased that value , then assigned it to the combo box

    No need for the DAO code, just put a query on the recordsource.

    not need for to assign the combo box to anything,....just use the combo box (as the field)

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

Similar Threads

  1. VBA gone wrong with an if
    By Ruegen in forum Programming
    Replies: 2
    Last Post: 10-21-2013, 05:38 PM
  2. What's wrong!
    By khalid in forum Programming
    Replies: 15
    Last Post: 06-27-2011, 06:38 AM
  3. What is wrong with this IFF?
    By bburton in forum Reports
    Replies: 2
    Last Post: 03-16-2011, 10:42 AM
  4. Replies: 6
    Last Post: 10-12-2010, 09:35 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