DoCmd.RunSQL using data from InputBox

brianrr23

New member
Local time
Today, 09:34
Joined
Mar 5, 2014
Messages
5
I am having an issue with running DoCmd.RunSQL using the data entered in an InputBox. Here is my code.

Dim strSqlPrevWeek As String

strSqlPrevWeek = "DELETE FROM PrevWeek " _
& "WHERE [PrevWeek].[Admit Term] = '" & strInputTerm & "' ;"

strInputTerm = InputBox("Enter the Term:")

DoCmd.RunSQL strSqlPrevWeek

This runs with no errors, but does not delete the records specified.

Thanks.
 
You have to have the InputBox first. The variable has no value when you use it.
 
Ahhh. That worked perfectly. Thanks for your help!
 

Users who are viewing this thread

Back
Top Bottom