I have a table and I would like to have the default value for a field to lookup a field in a query (with one record) Is there any way I can do this? I tried using a DLookup and it didn't seem to like that.
I have a table and I would like to have the default value for a field to lookup a field in a query (with one record) Is there any way I can do this? I tried using a DLookup and it didn't seem to like that.
You mean have a Form field already filled when you open it?
Just put the SQL statement for the query you want in the field's Default property. You can make sure it only returns a single Record by adding TOP 1 immediately after the SELECT keyword ("SELECT TOP 1 . . .").
You can also use the Form's On Load event to run a VBA function to give your Form default field values.