PC Review


Reply
Thread Tools Rate Thread

DLookUp Default Value

 
 
DS
Guest
Posts: n/a
 
      31st Jul 2008
How do you DLookup the Default Value of a field in a table.

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

Thanks
DS


 
Reply With Quote
 
 
 
 
Dirk Goldgar
Guest
Posts: n/a
 
      31st Jul 2008
"DS" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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.

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)

 
Reply With Quote
 
DS
Guest
Posts: n/a
 
      31st Jul 2008
Works Perfectly!
Thanks
DS


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
DLookup default Value rbb101 Microsoft Access Form Coding 5 25th Feb 2008 12:34 PM
Default value of combo box based on another that uses DLookUp Bob Wickham Microsoft Access Form Coding 17 6th Sep 2007 02:53 AM
Default value of combo box based on DLookUp Bob Wickham Microsoft Access 2 21st Aug 2007 10:55 AM
DLookup Default Value in form? =?Utf-8?B?YmVuZGl4ZW4=?= Microsoft Access Form Coding 2 2nd May 2007 06:59 PM
Rookie Dlookup vs Default Value.... Ray Gibson Microsoft Access Forms 12 14th May 2004 03:47 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:42 PM.