G
Guest
Hi,
I'm trying to use a for...next loop to collect info from 4 controls on a
subform (txtUpdC2_D1;txtUpdC2_D2;txtUpdC2_D3, and;txtUpdC2_D4) but can't seem
to get the syntax right. I get an error message: "Run-time error 438 Object
doesn't support this property or method."
Here's my code:
For j = 1 To 4
If (Not (Forms!frmCustomersViewEdit.frmCustomerDetailSubForm.txtUpdC2_D
& j) Like "") And (Not
IsNull((Forms!frmCustomersViewEdit.frmCustomerDetailSubForm.txtUpdC2_D & j)))
Then
consql = "INSERT INTO tblCustomerContractDocs (CustomerID,
StartDate, DocumentID) VALUES(" &
Forms!frmCustomersViewEdit!frmCustomerDetailSubForm!txtCustomerID & ", #" &
CDate(Forms!frmCustomersViewEdit!frmCustomerDetailSubForm!txtUpdC2_StartDate)
& "#, " & Forms!frmCustomersViewEdit!frmCustomerDetailSubForm!txtUpdC2_D & j
& ")"
MsgBox consql
'DoCmd.RunSQL (consql)
End If
next j
Any suggestions on how to get something like this to work
Thanks in advance.
Cheers,
PWR
I'm trying to use a for...next loop to collect info from 4 controls on a
subform (txtUpdC2_D1;txtUpdC2_D2;txtUpdC2_D3, and;txtUpdC2_D4) but can't seem
to get the syntax right. I get an error message: "Run-time error 438 Object
doesn't support this property or method."
Here's my code:
For j = 1 To 4
If (Not (Forms!frmCustomersViewEdit.frmCustomerDetailSubForm.txtUpdC2_D
& j) Like "") And (Not
IsNull((Forms!frmCustomersViewEdit.frmCustomerDetailSubForm.txtUpdC2_D & j)))
Then
consql = "INSERT INTO tblCustomerContractDocs (CustomerID,
StartDate, DocumentID) VALUES(" &
Forms!frmCustomersViewEdit!frmCustomerDetailSubForm!txtCustomerID & ", #" &
CDate(Forms!frmCustomersViewEdit!frmCustomerDetailSubForm!txtUpdC2_StartDate)
& "#, " & Forms!frmCustomersViewEdit!frmCustomerDetailSubForm!txtUpdC2_D & j
& ")"
MsgBox consql
'DoCmd.RunSQL (consql)
End If
next j
Any suggestions on how to get something like this to work
Thanks in advance.
Cheers,
PWR