Re: getting a form field to default to the value entered in the last record

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Marshall Barton (marshbarton_at_wowway.com)
Date: 10/07/04


Date: Thu, 07 Oct 2004 14:46:20 -0500

Paul James wrote:

>I do have a question about this, Marsh. What is the reason for
>concatenating the double quotation marks before and after Me.textbox? I
>would have thought it would work without them.

The DefaultValue property is a string. There are times when
you can get away without using them, but only when Access
makes the right guess in its automatic conversion process.
Since the Default value is evaluated as an expression, this
is a very iffy affair. The quotes are not required for
numeric values, but it is especially confusing with date
literals where the automatic conversions can change the date
to a different format depending on the local settings.

-- 
Marsh
MVP [MS Access]


Relevant Pages

  • Re: getting a form field to default to the value entered in the last record
    ... >concatenating the double quotation marks before and after Me.textbox? ... The DefaultValue property is a string. ... makes the right guess in its automatic conversion process. ...
    (microsoft.public.access.formscoding)
  • Re: Are _T() and TEXT() macros equivalent?
    ... David Ching wrote: ... I would say that the vast majority of the uses of the automatic conversion from narrow to wide string are with hard coded strings where the programmer simply forgot to use _T. ... Soon the ANSI code page will be gone, and hybrid UTF16/UTF8 applications may become more common, and the automatic conversion will do the wrong thing. ...
    (microsoft.public.vc.mfc)
  • String^, const char*, std::string, and c_str( )
    ... Therefore adopting the ... Much of our managed code is concerned with interfacing to native C++ code ... In Managed C++ there was an automatic conversion between ... a std::string or a String^. ...
    (microsoft.public.dotnet.languages.vc)
  • Re: SetString
    ... D4 does automatic conversion it creates a new WideString up to the ... pWC:PWideChar; ... // Automatic conversion to Ansi String ...
    (comp.lang.pascal.delphi.misc)