Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.databases.ms-access > #11977

Re: OpenArgs Again

From Ulrich Möller <knobbi38@arcor.de>
Newsgroups comp.databases.ms-access
Subject Re: OpenArgs Again
Date 2016-08-17 19:05 +0200
Organization A noiseless patient Spider
Message-ID <np25fv$cs$1@dont-email.me> (permalink)
References <8i8vpbpkscdt5n7u1i7rc694galnre2ng8@4ax.com>

Show all headers | View raw


Hi Croy,

Am 01.08.2016 um 21:32 schrieb croy:
> Can OpenArgs be used to set a DefaultValue of a control on
> the form being opened?
>
> I've been able to enter a value with OpenArgs, but it
> dirties the record, which I'd rather not do just yet.  When
> I adjust the Form's OnCurrent code to set the
> *DefaultValue*, the control then displays, "#Name?" when the
> form is opened.
>
> Possibly a timing issue?
>
no timing issues!

If you want to assign a value to a control's defaultvalue property in 
vba ms access evaluate the value as an expression which normally results 
in a display of "#name?". E.x. assign a string like "OnLoad" and you'll 
get the display "[Event Procedure]". So to overcome this problem just 
surround the string with single quotes.

here is a short code snipped:

Private Sub Form_Load()
   Debug.Print "Form_Load() ["; Me.OpenArgs; "]"
   Me!txtFilterDescription.DefaultValue = "'" & Me.OpenArgs & "'"
End Sub

Keep in mind if OpenArgs contains single or double quotes you have to 
escape this quotes as you would normally do this for each other expression.

Ulrich


Back to comp.databases.ms-access | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

OpenArgs Again croy <croy@invalid.net> - 2016-08-01 12:32 -0700
  Re: OpenArgs Again Mike P <mikewpayne@tiscali.co.uk> - 2016-08-02 10:09 -0700
    Re: OpenArgs Again croy <croy@invalid.net> - 2016-08-02 11:48 -0700
      Re: OpenArgs Again croy <croy@invalid.net> - 2016-08-02 12:03 -0700
  Re: OpenArgs Again Patrick Finucane <patrickfinucanetx@gmail.com> - 2016-08-03 16:03 -0700
    Re: OpenArgs Again croy <croy@invalid.net> - 2016-08-16 08:12 -0700
      Re: OpenArgs Again Patrick Finucane <patrickfinucanetx@gmail.com> - 2016-08-16 15:17 -0700
      Re: OpenArgs Again Mike P <mikewpayne@tiscali.co.uk> - 2016-08-17 06:33 -0700
  Re: OpenArgs Again pstanton54@gmail.com - 2016-08-16 23:40 -0700
  Re: OpenArgs Again Patrick Finucane <patrickfinucanetx@gmail.com> - 2016-08-17 05:51 -0700
  Re: OpenArgs Again Ulrich Möller <knobbi38@arcor.de> - 2016-08-17 19:05 +0200
  Re: OpenArgs Again pstanton54@gmail.com - 2016-08-17 14:33 -0700

csiph-web