By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,916 Members | 1,286 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,916 IT Pros & Developers. It's quick & easy.

Updating an Access Table with data from a Form, one null responce

P: 1
I am trying to use a Form to update three fields in a Table. However only two of the three fields are populating correctly. I'm sure there is a step I'm missing in my SQL statement but I cant figure it out for the life of me.
My Form (FrontPage) has these fields
WhoTest - Combo Box pulling it's options from a separate table (Names)
WhoDate - text box with Short Date values
TestHours - text box

The table I am trying to update is "Hours" with these corresponding fields in it
Name = WhoTest
TestDate = WhoDate
Hours = TestHours

When I click on my command button TestDate and Hours populate correctly but Name does not.
I do receive an error message stating "Access can't append all the records in the append query."

Here is the code I am using.
Expand|Select|Wrap|Line Numbers
  1. Private Sub THourUpdate_Click()
  5.   Dim strSQL As String
  9.      strSQL = "INSERT INTO Hours (Name, TestDate, Hours) VALUES ('" & Me!WhoTest & "', '" & Me!WhoDate & "', '" & Me!TestHours & "');"
  11.      DoCmd.RunSQL strSQL
  15.   End Sub
Thanks in advance for any help.
Jan 16 '19 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.