|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Hello,
Please help - I keep getting a compile error and I'm running out of ideas. Please tell me what the problem is!! Private Sub cmdSignOffNoException_Click() 'record sign-off data into sign-off table (tblSignOff) Dim db As DATABASE Dim sSql As String Set db = CurrentDb sSql = "INSERT INTO tblSignOff(BusinessName,TotalMTD) values ('"&Me.frmSalespersonINPV.controls.BusinessName&"','"&me.frmSalespersonINPV.Controls.SumOfMTD Client Value&"')" Debug.Print db.Execute (sSql) End Sub Thank you and have a wonderful day, Sam |
|
#2
|
|||
|
|||
|
Sam,
Try changing the SQL and see if that helps sSQL = "INSERT INTO tblSignOff (BusinessName, TotalMTD) " & _ "SELECT tblSignOff.BusinessName, tblSignOff.TotalMTD " & _ "FROM tblSignOff " & _ "WHERE (((tblSignOff.BusinessName)=[Forms]![frmSalespersonINPV]![BusinessName]) " & _ "AND ((tblSignOff.TotalMTD)=[Forms]![frmSalespersonINPV]![SumOfMTD Client Value]))" lwells |
![]() |
| Viewing: Dev Articles Community Forums > Databases > Microsoft Access Development > Problems with INSERT statement (from the subform) |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|