Solved

Access 2007 default field in subform

Posted on 2011-02-22
2
250 Views
Last Modified: 2012-06-21
Hi,
   I have a subform that uses the DLookup function as a Default Value for one of its fields. It does a DLookup on a field in the main form and tries to populate based on the result. For a while it was working without any issues but seems to intermittently break.

What the field will do is generate an accurate default value before the subform has been entered while the user is still completing the main form. Then once the user enters the subform to enter records, the default value will disappear from that field and the field will be null or blank and the user will have to manually enter the value.

I'm not sure what is causing this but there is another default valued field next to the suspect one which does not use DLookup and is simply set to duplicate a field value on the main form. This default value never resets itself and works fine.

Any help will be much appreciated,
 Thank you,
 Preston
0
Comment
Question by:prophet001
2 Comments
 
LVL 31

Accepted Solution

by:
Helen_Feddema earned 500 total points
ID: 34953372
We probably need to see the database to give more specific advice, but you may want to change to getting the value through a link, or possibly a tiny subform to just yield the value (instead of DLookup).  
0
 

Author Comment

by:prophet001
ID: 34953931
Hey Helen,
 Thank you very much for your response. You inspired me to try and use a wrapper function in VBA and wrap the DLookup function. This seems to be working well right now and there's no issues so far. I am going to go ahead and say that this is the solution. :)
Thank you again,
 Preston
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

In the previous article, Using a Critera Form to Filter Records (http://www.experts-exchange.com/A_6069.html), the form was basically a data container storing user input, which queries and other database objects could read. The form had to remain op…
It took me quite some time to sort out all the different properties of combo and list boxes available from Visual Basic at run-time. Not that the documentation is lacking: the help pages are quite thorough and well written. The problem was rather wh…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

758 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now