Zeroanarchy
Technical User
Hi,
I have been banging my head of a wall for a bit on this one.
What I am tring to do is work out if certain fields exist in a table if so proceed to count them to make sure we have some records.
here is what I am up to
Greatful for your help.
ZeroAnarchy
Experience is a wonderful thing. It enables you to recognize a mistake
when you make it again.
I have been banging my head of a wall for a bit on this one.
What I am tring to do is work out if certain fields exist in a table if so proceed to count them to make sure we have some records.
here is what I am up to
Code:
Dim td As TableDef
Dim fld As DAO.Field
Dim FieldsExist As String
Dim intx As String
FieldsExist = False
Set td = CurrentDb.TableDefs("Raw Material Prices")
For Each fld In td.Fields
If fld.Name = "Cost" And "PRODUCT CODE" And "Product Name" Then
FieldsExist = True
intx = DCount("[COST]", "Raw Material Prices")
MsgBox intx
End If
Next fld
Greatful for your help.
![[afro] [afro] [afro]](/data/assets/smilies/afro.gif)
Experience is a wonderful thing. It enables you to recognize a mistake
when you make it again.