Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms / May 2007

Tip: Looking for answers? Try searching our database.

Can I change the default value of a control?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Tony Williams - 23 May 2007 15:17 GMT
I have a form which has a number of controls where the control source is a
DLookup statement, eg the value of txtSurname is a DLookup which compares a
membership number on the form with the membership number in a table and then
returns the equivalent surname. However there are times when I don't have a
membership number but still want to input a surname but when I click in the
surname control I can't enter any text. The form is based on a query which
links two tables. can anyone tell me a way around this?
Thanks
Tony
Carl Rapson - 23 May 2007 17:36 GMT
>I have a form which has a number of controls where the control source is a
> DLookup statement, eg the value of txtSurname is a DLookup which compares
[quoted text clipped - 9 lines]
> Thanks
> Tony

What I would do is remove the DLookUp from the Control Source of the control
and put it in the Form_Current event instead:

   Me.txtControl = Nz(DLookUp(...),"")

That way, the value is set whenever a record is displayed, but you can also
type in your own value.

Carl Rapson
Tony Williams - 23 May 2007 19:28 GMT
Thanks Carl
Tony
>>I have a form which has a number of controls where the control source is a
>> DLookup statement, eg the value of txtSurname is a DLookup which compares
[quoted text clipped - 20 lines]
>
> Carl Rapson
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.