Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

How to pull default value form another table in access

Posted on 2008-11-18
2
Medium Priority
?
1,202 Views
Last Modified: 2013-11-29
Is it possible to pull the default value of a field form another table?  If so how?  I am running access 2007.
0
Comment
Question by:itsolutionsus
1 Comment
 
LVL 85

Accepted Solution

by:
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 1000 total points
ID: 22986311
You can, but it's not the simplest thing to do. You'd have to do something like this:

Dim dbs As DAO.Database
Dim tdf As DAO.Tabledef
Dim fld As DAO.Field
Dim vDefaultValue As Variant

Set dbs = CurrentDB
Set tdf = dbs.TableDefs("YourTable")
Set fld = tdf.Fields("YourField")

vDefaultValue = fld.DefaultValue

0

Featured Post

Veeam and MySQL: How to Perform Backup & Recovery

MySQL and the MariaDB variant are among the most used databases in Linux environments, and many critical applications support their data on them. Watch this recorded webinar to find out how Veeam Backup & Replication allows you to get consistent backups of MySQL databases.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Traditionally, the method to display pictures in Access forms and reports is to first download them from URLs to a folder, record the path in a table and then let the form or report pull the pictures from that folder. But why not let Windows retr…
Beware when using the ListIndex and the Column() properties of a listbox in Access 2007.  A bug has been identified in the Access 2007 listbox code which can cause the .ListIndex property to return a -1, and the .Columns(#) property to return a NULL…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …

581 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question