424,279 Members | 1,907 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,279 IT Pros & Developers. It's quick & easy.

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

P: 1
Hi,
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()
  2.  
  3.  
  4.  
  5.   Dim strSQL As String
  6.  
  7.  
  8.  
  9.      strSQL = "INSERT INTO Hours (Name, TestDate, Hours) VALUES ('" & Me!WhoTest & "', '" & Me!WhoDate & "', '" & Me!TestHours & "');"
  10.  
  11.      DoCmd.RunSQL strSQL
  12.  
  13.  
  14.  
  15.   End Sub
Thanks in advance for any help.
4 Weeks Ago #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.