Results 1 to 2 of 2
  1. #1
    Lockrin is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Dec 2009
    Posts
    52

    Default value a DLookup?


    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.

  2. #2
    Rawb is offline Expert
    Windows XP Access 2000
    Join Date
    Dec 2009
    Location
    Somewhere
    Posts
    875
    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.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Need help with dlookup.
    By Keith in forum Database Design
    Replies: 8
    Last Post: 05-24-2010, 06:28 PM
  2. Dlookup??
    By Vikki in forum Access
    Replies: 4
    Last Post: 02-16-2010, 07:59 AM
  3. Subform Dlookup
    By jbedward in forum Forms
    Replies: 7
    Last Post: 01-13-2010, 08:06 AM
  4. Dlookup
    By janjan_376 in forum Access
    Replies: 20
    Last Post: 07-07-2009, 07:40 AM
  5. Dlookup question
    By nkenney in forum Forms
    Replies: 3
    Last Post: 07-01-2009, 06:36 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums