J
James
Hello,
Right my problem is that I am trying to write some code
that will go through each record in a table and send them
an e-mail with an attachment based on who they are.
At the moment I am trying to do this by using VBA to go
through each record by using For Each command. At the
moment I can only find out how to get it to go through
the field names not the recores. However it still doesnt
work. It comes up with errors like "Type mismatch"
or "operation is not supported for this type of object".
Below is my code, I have copied it from the VBA help file.
Dim dbs As Database, tbl As TableDef, fld As Field
Set dbs = CurrentDb
Set tbl = dbs.TableDefs("tutor")
For Each fld In tbl.Fields
SendObject etc....
Next fld
Is it obvious what I am doing wrong, do I need any
references I am not using?
Thanks in advance if you can help.
James
Right my problem is that I am trying to write some code
that will go through each record in a table and send them
an e-mail with an attachment based on who they are.
At the moment I am trying to do this by using VBA to go
through each record by using For Each command. At the
moment I can only find out how to get it to go through
the field names not the recores. However it still doesnt
work. It comes up with errors like "Type mismatch"
or "operation is not supported for this type of object".
Below is my code, I have copied it from the VBA help file.
Dim dbs As Database, tbl As TableDef, fld As Field
Set dbs = CurrentDb
Set tbl = dbs.TableDefs("tutor")
For Each fld In tbl.Fields
SendObject etc....
Next fld
Is it obvious what I am doing wrong, do I need any
references I am not using?
Thanks in advance if you can help.
James