I guess I'm having an off day today, nothing seems to be working for me, and now it's my for loops.
I need to go through each field in a table and return the names of those fields to determine what variables need to be set at.
Granted I'm not too familiar with Access, but I've tried all the .table stuff I can think of.
Edit: Now that I've updated the code, I'm coming up with a 3219 Run Time error, which says Invalid Operation at the beginning of the case selection.
Thus far my code consists of:
And even then it's some bastardized code I found somewhere in Google that doesn't work.
Thank in advance!
Stephen
I need to go through each field in a table and return the names of those fields to determine what variables need to be set at.
Granted I'm not too familiar with Access, but I've tried all the .table stuff I can think of.
Edit: Now that I've updated the code, I'm coming up with a 3219 Run Time error, which says Invalid Operation at the beginning of the case selection.
Thus far my code consists of:
Code:
Sub WhichFieldNames(ByVal strTable As String)
Dim db As Database
Dim tbl As TableDef
Dim fld As Field
Set db = CurrentDb
Set tbl = db.TableDefs(strTable)
For Each fld In tbl.Fields
Select Case fld
cases
End Select
Next
End Sub
And even then it's some bastardized code I found somewhere in Google that doesn't work.
Thank in advance!
Stephen
Last edited: