R
Richard Hollenbeck
I'm very sorry for reposting this, but I made a mistake on the first post
and I tried to fix it with a reply. Usually whenever I reply to my own
posts I never receive a reply from the group. Here's the corrected version
of my original post:
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 append (INSERT INTO) 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
Apologies for the double posting and many thanks for any replies,
Rich Hollenbeck
and I tried to fix it with a reply. Usually whenever I reply to my own
posts I never receive a reply from the group. Here's the corrected version
of my original post:
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 append (INSERT INTO) 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
Apologies for the double posting and many thanks for any replies,
Rich Hollenbeck