DLookUp Default Value

  • Thread starter Thread starter DS
  • Start date Start date
D

DS

How do you DLookup the Default Value of a field in a table.

Me.TxtVal = DLookup("ChkMessage","tblChecks")

Thanks
DS
 
DS said:
How do you DLookup the Default Value of a field in a table.

Me.TxtVal = DLookup("ChkMessage","tblChecks")


You can't do it with DLookup, if I understand what you mean. DLookup can
return only values that actually exist in the table, not values that *might*
be added if someone adds a record without specifying a value for the field.

However, you can do it using DAO:

Me.TxtVal = _
CurrentDb.TableDefs("tblChecks").Fields("ChkMessage").DefaultValue

Bear in mind that the DefaultValue property is a string, and will be a
zero-length string if the field doesn't have a default value.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top