Get values from text/combo boxes on form to different table

33 Views Asked by At
Dim strSQL As String
Dim strSQL1 As String
Dim strSQL2 As String
Private Sub Command208_Click()
strSQL = "INSERT INTO PKR([Claim Number],[WANDFNF],[WANDOUP],[WANDEA]) VALUES ([Forms]![Form Level].[Form]![Claim Number],[Forms]![Form Level].[Form]![Wand_cmb1],[Forms]![Form Level].[Form]![Wand_cmb2],[Forms]![Form Level].[Form]![Wand_txt2])"
strSQL1 = "INSERT INTO PKR([TranFNF],[TranOUP],[TranEA]) VALUES ([Forms]![Form Level].[Form]![Tran_cmb1],[Forms]![Form Level].[Form]![Tran_cmb2],[Forms]![Form Level].[Form]![Tran_txt2])"
strSQL2 = "INSERT INTO PKR([DRFNF],[DROUP],[DREA]) VALUES ([Forms]![Form Level].[Form]![DR_cmb1],[Forms]![Form Level].[Form]![DR_cmb2],[Forms]![Form Level].[Form]![DR_txt2])"
 
 DoCmd.SetWarnings False
    DoCmd.RunSQL strSQL
    DoCmd.SetWarnings True
 DoCmd.SetWarnings False
    DoCmd.RunSQL strSQL1
    DoCmd.SetWarnings True
 DoCmd.SetWarnings False8
    DoCmd.RunSQL strSQL2
    DoCmd.SetWarnings True
End Sub

Here i have build a button command_208 to get data from text/combo boxes on a form to different table PKR. I am able to get data for 1st query but not getting any data for the strSQL1 & strSQL2.

0

There are 0 best solutions below