Results 1 to 2 of 2
2004-07-22, 10:50 #1
- Join Date
- Jul 2004
- Thanked 0 Times in 0 Posts
Fully Qualifying a Field in a Table (Access 2000)
I need to know the correct syntax for fully qualifying a fireld in a table within VBA.
2004-07-22, 10:59 #2
- Join Date
- Mar 2002
- Thanked 28 Times in 28 Posts
Re: Fully Qualifying a Field in a Table (Access 2000)
It depends on where you want to do this.
If this is in the code behind a form or report, you can refere to the fields in the record source of the form/report as Me.FieldName. If the field name contains spaces or unusual characters, you must enclose it in square brackets: Me.[Field Name].
For other situations, you may be able to use a function such as DLookup: DLookup("FieldName", "TableName") or DLookup("FieldName", "TableName", "OtherField = 37")
And if you want to loop through the records of a table, or if you want to modify the value of a field, you can open a DAO or ADO recordset on the table.
Note: simply using something like TableName.FieldName will not work in general.
If you want more assistance, please provide some details of what you want to accomplish.