inserting info from a form into a table

B

bfreeman

I have built a query that gets out Incentives that a Volunteer has
earned. However, once in the access form, the volunteer has earned the
incentive a user must approve this by entering the date the volunteer
receives the incentive and then the values:
IncentiveTypeID, VolunteerID, and Date are inserted into the
IncentivesReceived table of the database.

Here is my code and it works, sort of... it pops up parameter boxes for
me to enter in the ID's and date and appends a row to the
IncentiveReceived table. I need it to do that just when a user enters
the date, it saves the information in the IncentivesReceived table.


Code:
--------------------



Private Sub Text8_LostFocus()
Dim strSQL

strSQL = "INSERT into IncentiveReceived "
strSQL = strSQL + "(`IncentiveTypeID`,`VolunteerID`,`Date`) "
strSQL = strSQL + "VALUES ([IncentiveTypes]![IncentivesTypeID],[IncentiveTypes]![VolunteerID],[IncentiveTypes]![Date])"

DoCmd.RunSQL (strSQL)

End Sub


--------------------


Can anyone help? I would appreciate it.

Thanks in advanced.

baf
 

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