A
Andy
Hi;
Found: 209479 ACC2000: How to Use Visual Basic for Applications to Check for
Duplicate Values in a Field example.
Trying to convert it to work in my DBase.
Snippet example:
Private Sub CustomerID_BeforeUpdate(Cancel As Integer)
Dim x As Variant
x = DLookup("[CustomerID]", "Customers", "[CustomerID]= '" _
& Forms!newcustomers!CustomerID & "'")
The Obstacle is this line:
Private Sub txtProdNumber_BeforeUpdate(Cancel As Integer)
Dim x As Variant
x = DLookup("[txtProdNumber]", "sfrmProducts", "[txtProdNumber]= '" _
&
Forms!frmProdCatagory!sfrmProdSubCat!sfrmProducts.Forms![txtProdNumber] &
"'")
Tried Brackets on all "Form Names". Returns "This Object doesn't support
this property or method".
Tried
x = DLookup("[txtProdNumber]",
"frmProdCatagory!sfrmProdSubCat!sfrmProducts", "[txtProdNumber]= '" _
&
Forms!frmProdCatagory!sfrmProdSubCat!sfrmProducts.Forms![txtProdNumber] &
"'")
Same Error.
A few more combinations led to "Can't find txtProdNumber".
I know it has to do with referring to the control on the "Sub-SubForm".
Checked MVPs web-site and followed it correctly. No Go. Checked
Microsoft's support and followed correctly. Still No Go.
What is the correct way to refer to the control in this instance?
Thank You.
Andy
Found: 209479 ACC2000: How to Use Visual Basic for Applications to Check for
Duplicate Values in a Field example.
Trying to convert it to work in my DBase.
Snippet example:
Private Sub CustomerID_BeforeUpdate(Cancel As Integer)
Dim x As Variant
x = DLookup("[CustomerID]", "Customers", "[CustomerID]= '" _
& Forms!newcustomers!CustomerID & "'")
The Obstacle is this line:
Private Sub txtProdNumber_BeforeUpdate(Cancel As Integer)
Dim x As Variant
x = DLookup("[txtProdNumber]", "sfrmProducts", "[txtProdNumber]= '" _
&
Forms!frmProdCatagory!sfrmProdSubCat!sfrmProducts.Forms![txtProdNumber] &
"'")
Tried Brackets on all "Form Names". Returns "This Object doesn't support
this property or method".
Tried
x = DLookup("[txtProdNumber]",
"frmProdCatagory!sfrmProdSubCat!sfrmProducts", "[txtProdNumber]= '" _
&
Forms!frmProdCatagory!sfrmProdSubCat!sfrmProducts.Forms![txtProdNumber] &
"'")
Same Error.
A few more combinations led to "Can't find txtProdNumber".
I know it has to do with referring to the control on the "Sub-SubForm".
Checked MVPs web-site and followed it correctly. No Go. Checked
Microsoft's support and followed correctly. Still No Go.
What is the correct way to refer to the control in this instance?
Thank You.
Andy