Updating table based on form

  • Thread starter Thread starter Joel
  • Start date Start date
J

Joel

I have a form that has three (3) fields on it. Two of the fields are
currently in the db and the third is new info. I am trying to compare
the fields with the table and post the third into that particular
record. I have been experimenting with my own insanity and need help.
My last try at this was to use a query behind a cmd button. The query
is stated below. Any help would be appreciated because the answer just
escapes me and I know it is in from of my eyes.

INSERT INTO [TimeSheet]![OutTime]
WHERE (((TimeSheet.UserName)=[Forms]![frmOutTimeCard]![UserName]) AND
((TimeSheet.Date)=[Forms]![frmOutTimeCard]![Date]) AND
((TimeSheet.OutTime)=[Forms]![frmOutTimeCard]![OutTime]));

It is the last field I am trying to the table based on finding the
"username and date".
 
Dear Joel:

What I see is this.

You said:

"post the third into that particular record"

That makes me think you want to "UPDATE" a column in that existing record.

The query you show is a query to INSERT new records into a table. That does
not seem like what you said you wanted to do.

Do you want to add new records, or change existing ones?

Tom Ellison
 
I am sorry for my poor discription. I have a form that has three (3)
text fields. The first field value is passed from the previous form.
The second is the current date (date()). The third is the current time
(time()). I want to find the record in the table based on the first
two fields and post the third to that particular record. The table is
"timesheet" and the table fields are username, date, outtime. The
form's text fields are unbound and so is the form. The text fields
have the same names as the table fields.
 
Tom, I just realized that the form is not unbound but bound to the
timesheet table. Sorry..
 
Dear Joel:

I strongly recommend you not store a date and a time in separate columns.
Date() plus Time() is Now() and can go into a single column.

You can subsequently split up the column into date and time components as
needed.

Tom Ellison
 
Back
Top