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_Er r
Dim rstEvalForm As Recordset
'Set the variable by opening the Table: tblRMAEval.
Set rstEvalForm = CurrentDb.OpenR ecordset("tblRM AEval", dbOpenDynaset)
With rstEvalForm
'Add a new record to the end of the Recordset Object.
.AddNew
![idsRMA#] = Me.[txtRMA#]
![dtmDate] = Me.cboEvalDate
![chrTech] = Me.cboTechName
![blnLooseHardwar eCheck] = Me.chkHardware
![blnWiringConnec tionsCheck] = Me.chkWiring
![blnOpticsCheck] = Me.chkOptical
![chrVisualCommen ts] = Me.txtVisualCom ments
![blnShortsCheck] = Me.chkShorts
![chrShotsCount] = Me.txtShots
![intInputE] = Me.txtInputE
![intDoubleE] = Me.txtDoubleE
![intPFNE] = Me.txtPFNE
![intSCRE] = Me.txtSCRE
![chrPowerComment s] = Me.txtPowerComm ents
![blnLaserFire] = Me.chkFired
![int10ShotAvg] = Me.txt10Shot
![intPW] = Me.txtPW
![blnATREnergy] = Me.chkATR
![blnGUITest] = Me.chkGUI
![chrLaserComment s] = Me.txtLaserComm ents
![intFirstTargetA ctual] = Me.txtFirstBIT
![intLastTargetAc tual] = Me.txtLastBIT
.Update
End With
'Close the recordset and set it to nothing.
rstEvalForm.Clo se
Set rstEvalForm = Nothing
cmdSubmit_Click _Exit:
ExitSub
cmdSubmit_Click _Err:
MsgBox Err.Description
Resume cmdSubmit_Click _Err
End Sub
Thanks in advance.
Troy Lee
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_Er r
Dim rstEvalForm As Recordset
'Set the variable by opening the Table: tblRMAEval.
Set rstEvalForm = CurrentDb.OpenR ecordset("tblRM AEval", dbOpenDynaset)
With rstEvalForm
'Add a new record to the end of the Recordset Object.
.AddNew
![idsRMA#] = Me.[txtRMA#]
![dtmDate] = Me.cboEvalDate
![chrTech] = Me.cboTechName
![blnLooseHardwar eCheck] = Me.chkHardware
![blnWiringConnec tionsCheck] = Me.chkWiring
![blnOpticsCheck] = Me.chkOptical
![chrVisualCommen ts] = Me.txtVisualCom ments
![blnShortsCheck] = Me.chkShorts
![chrShotsCount] = Me.txtShots
![intInputE] = Me.txtInputE
![intDoubleE] = Me.txtDoubleE
![intPFNE] = Me.txtPFNE
![intSCRE] = Me.txtSCRE
![chrPowerComment s] = Me.txtPowerComm ents
![blnLaserFire] = Me.chkFired
![int10ShotAvg] = Me.txt10Shot
![intPW] = Me.txtPW
![blnATREnergy] = Me.chkATR
![blnGUITest] = Me.chkGUI
![chrLaserComment s] = Me.txtLaserComm ents
![intFirstTargetA ctual] = Me.txtFirstBIT
![intLastTargetAc tual] = Me.txtLastBIT
.Update
End With
'Close the recordset and set it to nothing.
rstEvalForm.Clo se
Set rstEvalForm = Nothing
cmdSubmit_Click _Exit:
ExitSub
cmdSubmit_Click _Err:
MsgBox Err.Description
Resume cmdSubmit_Click _Err
End Sub
Thanks in advance.
Troy Lee
Comment