giving me error when compiler run the query i thing the only thing which is messing is the check box yes/no i don't know how to store the check box state into the table field...
please find me the solution...
thank you
Private Sub Chop_it_Click()
Dim sql_val As String
Dim sql_loop As String
Dim frm_serv_ip As String
Dim frm_serv_port As Integer
Dim frm_CRID As String
Dim frm_num_chop As Integer
Dim frm_Uprice As Integer
Dim frm_payment_rece As Boolean
Dim frm_start As Date
Dim frm_exp As Date
Dim Vtemp As Integer
Dim x As Integer
Dim y As Integer
'Here first we check whether or not if any record exists in the table
If CurrentDb.OpenRecordset("SELECT COUNT(CRID_index.CRID_num) FROM CRID_index")(0) > 0 Then
Vtemp = CurrentDb.OpenRecordset("SELECT MAX(CRID_index.CRID_num) FROM CRID_index")(0)
Else
Vtemp = 0
End If
'assign chop gear form values to vb variables "frm*"
frm_serv_ip = cg_serv_ip
frm_serv_port = cg_serv_port
frm_CRID = cg_CRID
frm_num_chop = cg_chp_num
frm_Uprice = cg_unit_price
frm_payment_rece = cg_p_chk
frm_start = cg_start
frm_exp = cg_exp
x = 0
y = frm_num_chop
Do While x < y
x = x + 1
frm_num_chop = frm_num_chop + 1
DoCmd.RunSQL "INSERT INTO CRID_index ([CRID], [CRID_num], [server_ip], [server_port], [payment], [validation_period], [start_date], [exp_date])" & _
"VALUES ('frm_CRID', 'frm_num_chop', 'frm_serv_ip', 'frm_serv_port', 'frm_Uprice', 'frm_validation', 'frm_start', 'frm_exp');"
Loop
End Sub