simple UPDATE query--difficult-to-find syntax error

R

Richard Hollenbeck

I have two functions: getCC and getCD. One will prompt the user for a
course code (getCC) for a new college course, and the other will prompt the
user for a course description (getCD) for the same new college course. I
want to update the table [courses] with this new course.

Here are the two functions and the subroutine with the query:

Private Function getCC() As String
getCC = Nz(InputBox("Input course code for new course. . .", "New course
code"))
End Function

Private Function getCD() As String
getCD = Nz(InputBox("Input course description for new course. . .", "New
course description"))
End Function

Private Sub cmdNewCourse_Click()
Dim StrSQL As String
StrSQL = "INSERT INTO courses(courseCode, courseDescription) "
StrSQL = StrSQL & "VALUES ('" & getCC & "' , '" & getCD & "');"
CurrentDb.Execute StrSQL, dbFailOnError
End Sub

Many thanks,
Rich Hollenbeck
 
R

Richard Hollenbeck

Sorry, It's an INSERT INTO query. I'm very sorry. SAME QUESTION!! Thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top