I have a linked table (two primary keys: one coming from Me.txtRMA#
and the other is an Autonumber) that I am writing to from an unbound
form. Please review my code and tell me what is wrong with it. I don't
get any errors and no data is written to the table. It doesn't do
anything. Thanks for the help
Private Sub cmdSubmit_Click()
On Error GoTo Submit_Click_Err
Dim rstEvalForm As Recordset
'Set the variable by opening the Table: tblRMAEval.
Set rstEvalForm = CurrentDb.OpenRecordset("tblRMAEval", dbOpenDynaset)
With rstEvalForm
'Add a new record to the end of the Recordset Object.
.AddNew
![idsRMA#] = Me.[txtRMA#]
![dtmDate] = Me.cboEvalDate
![chrTech] = Me.cboTechName
![blnLooseHardwareCheck] = Me.chkHardware
![blnWiringConnectionsCheck] = Me.chkWiring
![blnOpticsCheck] = Me.chkOptical
![chrVisualComments] = Me.txtVisualComments
![blnShortsCheck] = Me.chkShorts
![chrShotsCount] = Me.txtShots
![intInputE] = Me.txtInputE
![intDoubleE] = Me.txtDoubleE
![intPFNE] = Me.txtPFNE
![intSCRE] = Me.txtSCRE
![chrPowerComments] = Me.txtPowerComments
![blnLaserFire] = Me.chkFired
![int10ShotAvg] = Me.txt10Shot
![intPW] = Me.txtPW
![blnATREnergy] = Me.chkATR
![blnGUITest] = Me.chkGUI
![chrLaserComments] = Me.txtLaserComments
![intFirstTargetActual] = Me.txtFirstBIT
![intLastTargetActual] = Me.txtLastBIT
.Update
End With
'Close the recordset and set it to nothing.
rstEvalForm.Close
Set rstEvalForm = Nothing
cmdSubmit_Click_Exit:
ExitSub
cmdSubmit_Click_Err:
MsgBox Err.Description
Resume cmdSubmit_Click_Err
End Sub
Thanks in advance.
Troy Lee