G
GoBrowns!
I am trying to write code that will append a newly created record from my
form into a table. Several of the fields in my form are not tied to anything
(no table/query behind them) and some are. Here is what I wrote, I am pretty
sure I am way off base:
Private Sub cmdSubmit_Click()
'Asks user one more time if they are sure they want to submit,
'then appends form data to table and clears form.
Dim strAppend As String
strAppend = "INSERT INTO tblAttendanceRecords(txtEmployeeID as
EmployeeID, _
cboEmployeeName as EmployeeName, _
datDate as Date, _
txtVacationUsed as VacationTimeUsed, _
txtSickUsed as SickTimeUsed, _
ckProperDoc as ProperDocumentationFiled, _
ckTardy as Tardy, _
cboTimeTardy as TardyTime, _
ckMissedPunch as MissedPunch, _
ckOccurrence as Occurrence, _
cboTypeOccurrence as Occurrence, _
txtOccurrenceValue as OccurrenceValue, _
cboNonOccurrence as NonOccurrenceDescription, _
txtAdditionalComments as AdditionalComments)";
DoCmd.RunSQL strAppend
I think I have my SQL and VBA mixed up? Who knows, I am so confused.
Ideally, I would like this "on click" operation to also clear the form once
the information has been append to the table.
Are these things even possible? Please help!
Thanks!
form into a table. Several of the fields in my form are not tied to anything
(no table/query behind them) and some are. Here is what I wrote, I am pretty
sure I am way off base:
Private Sub cmdSubmit_Click()
'Asks user one more time if they are sure they want to submit,
'then appends form data to table and clears form.
Dim strAppend As String
strAppend = "INSERT INTO tblAttendanceRecords(txtEmployeeID as
EmployeeID, _
cboEmployeeName as EmployeeName, _
datDate as Date, _
txtVacationUsed as VacationTimeUsed, _
txtSickUsed as SickTimeUsed, _
ckProperDoc as ProperDocumentationFiled, _
ckTardy as Tardy, _
cboTimeTardy as TardyTime, _
ckMissedPunch as MissedPunch, _
ckOccurrence as Occurrence, _
cboTypeOccurrence as Occurrence, _
txtOccurrenceValue as OccurrenceValue, _
cboNonOccurrence as NonOccurrenceDescription, _
txtAdditionalComments as AdditionalComments)";
DoCmd.RunSQL strAppend
I think I have my SQL and VBA mixed up? Who knows, I am so confused.
Ideally, I would like this "on click" operation to also clear the form once
the information has been append to the table.
Are these things even possible? Please help!
Thanks!