Link to home
Start Free TrialLog in
Avatar of pdvsa
pdvsaFlag for United States of America

asked on

Update strSQL with input box

Experts,

I am using the code below to add X number of days to a [DueDate].  I want to make it more dynamic and i/o having numerous buttons on the report for Adding 1 Day, 2 Days, 3 Days to the [DueDate] I would rather have an input box.  I thought I could add the bolded areas below i/o having a hard coded number.

I get an error with the below.  
How can I do what I am proposing?  

thank you
 
        Dim strSQL As String
               strSQL = "UPDATE TASKS Set DueDate = DateAdd('d', [Enter Days to Add], DueDate) WHERE  status <> 'Completed' AND DueDate= Date() [Enter How Many Days Ago]"
           CurrentDb.Execute strSQL, dbFailOnError
            Me.Requery
ASKER CERTIFIED SOLUTION
Avatar of mbizup
mbizup
Flag of Kazakhstan image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of pdvsa

ASKER

nice!  worked perfectly.  I see what you did.  Got a little techy on me.  haha
<<I see what you did.>>

Good!  ;-)