[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Default Value in Cell

Posted on 2014-01-03
3
Medium Priority
?
258 Views
Last Modified: 2014-01-04
I have a query that only has 1 row to it. I would like the default value of a field to the third column of that row.

I tried to simply reference that cell in expression field like this:

=[qryWhosComputer]![Last]

Unfortunately it comes up an error. Is there a way I can refence the default value to be that "Last" column of that query? Maybe telling it the first row somehow? All the query does is match to values from two tables. There always is a one-to-one relationship.

Thanks for any help you can provide!
0
Comment
Question by:cansevin
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 2000 total points
ID: 39755382
try using dlookup()


=dlookup("[Last]","qryWhosComputer")
0
 
LVL 39

Expert Comment

by:PatHartman
ID: 39755451
1.  Defaults can be set for columns in tables, controls on forms, or in code behind a form.  Queries do not support defaults, events, or code.
2. Users should NEVER be exposed to a query.  You should always use a form for data entry or a report for displaying data.

To do what you are asking in a form, you can use the Form's BeforeUpdate event.  You can either just fill in the empty value or you can prompt.

If Me.SomeField & "" = "" Then
    Me.SomeField = Me.ThirdColumn
End If

Open in new window

0
 

Author Closing Comment

by:cansevin
ID: 39756425
Thanks! Worked.
0

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
Instead of error trapping or hard-coding for non-updateable fields when using QODBC, let VBA automatically disable them when forms open. This way, users can view but not change the data. Part 1 explained how to use schema tables to do this. Part 2 h…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…

649 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