hey there,
ive used this code in many modules before but the .Execute line is getting hung up I believe due to a NULL Set (qry Returns no record to append). is that assumpiton correct
here is hte code:
more specifically, if the results for the string, strAgntkey are null then the execution line cannot complete the append.
thanks in advance.
IS there a way to use the IF(IsNull.....??????
aslo, the thing i do not understand is that if the Results are Zero and the Warnings are off wouldn't i just be appending ZERO records?
T
ive used this code in many modules before but the .Execute line is getting hung up I believe due to a NULL Set (qry Returns no record to append). is that assumpiton correct
here is hte code:
Code:
Public Sub Append400DatatoAccessTbl()
DoCmd.SetWarnings False
Dim rsAgntKey As Recordset
Dim x As Integer
Dim SQLT As String
Dim strAgntkey As String
Dim flds As DAO.Fields
Dim fld As DAO.Field
Set rsAgntKey = CurrentDb.OpenRecordset("qry_AgntKey_Parameter")
'this defines the desired field in the qry to be the parameter
Set flds = rsAgntKey.Fields
Set fld = flds("AGTKEY")
With rsAgntKey
.MoveFirst
Do While Not .EOF
strAgntkey = fld
Const QRY_APPEND = "qry_TxnsTbl_Metrcs_AgntKey_Parmd"
Dim db As DAO.Database
Dim qdf As DAO.QueryDef
Set db = CurrentDb
'this is the append query which ontain the parameter to gether necessary info
Set qd = db.QueryDefs("qry_TxnsTbl_Metrcs_AgntKey_Parmd")
qd.Parameters(0) = strAgntkey
qd.Execute
rsAgntKey.MoveNext
Loop
End With
Set rsAgntKey = Nothing
Set fld = Nothing
Set flds = Nothing
DoCmd.SetWarnings True
End Sub
more specifically, if the results for the string, strAgntkey are null then the execution line cannot complete the append.
thanks in advance.
IS there a way to use the IF(IsNull.....??????
aslo, the thing i do not understand is that if the Results are Zero and the Warnings are off wouldn't i just be appending ZERO records?
T
Last edited: