Run-time error '3075'

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Sophiecarr
    New Member
    • Jan 2010
    • 4

    Run-time error '3075'

    Hi,

    I am trying to use DLookup in relation to input from an option group. The option group has 3 options (Course Title), in a 'Core Modules' table, I have set the primary field to be the 'Course Title' and have two further fields containing core modules. I am aiming to update a text box with these core modules once the user clicks on their option. My code is as follows:

    Private Sub Frame10_AfterUp date()
    CoreModules = DLookup("[Core Sem 1]", "Core Modules", "[Course Title] = & Forms![Student]!Frame10")
    End Sub

    I am getting a run-time error 3075...a syntax error(missing operator) in query expression: [Course Title] = & Forms![Student]!Frame10"

    Any help would be greatly appreciated!

    Thanks
    Sophie
  • BlackLibrary
    New Member
    • Jan 2010
    • 16

    #2
    Small syntax issue.

    CoreModules = DLookup("[Core Sem 1]", "Core Modules", "[Course Title] = Forms![Student]!Frame10")

    It was the "&" that needed to be removed.

    Comment

    • MikeTheBike
      Recognized Expert Contributor
      • Jun 2007
      • 640

      #3
      Hi

      or perhapse
      Code:
      Private Sub Frame10_AfterUpdate()
          CoreModules = DLookup("[Core Sem 1]", "Core Modules", "[Course Title] = " & Forms![Student]!Frame10)
      End Sub
      ie move the closing "

      ??


      MTB

      Comment

      • Sophiecarr
        New Member
        • Jan 2010
        • 4

        #4
        Thank you so much, removing the & seems to have helped!

        Sophie

        Comment

        Working...