Group:  Microsoft Access ยป microsoft.public.access.formscoding
Thread: Default value on form coming from another table

Geek News

Default value on form coming from another table
Geraldwho 11/12/2008 5:28:14 PM
i would like to have the default value for my Inspector field on my
InspectionForm form come from my CompanyInfo table from a field called
Definsp. Since this table only has 1 record, can i get this value and pass it
on to the form control as a default value?
Re: Default value on form coming from another table
"Damon Heron" <damon_327[ at ]hotmail.com> 11/12/2008 5:33:26 PM
yourformcontrol= nz(dlookup("Definsp", "CompanyInfo"),0)

check out dlookup in help.

Damon

"Geraldwho" <Geraldwho[ at ]discussions.microsoft.com> wrote in message
news:7E65F183-571E-4A2E-9F04-60F04A240F30[ at ]microsoft.com...
[Quoted Text]
>i would like to have the default value for my Inspector field on my
> InspectionForm form come from my CompanyInfo table from a field called
> Definsp. Since this table only has 1 record, can i get this value and pass
> it
> on to the form control as a default value?


Re: Default value on form coming from another table
John W. Vinson <jvinson[ at ]STOP_SPAM.WysardOfInfo.com> 11/13/2008 1:00:39 AM
On Wed, 12 Nov 2008 09:28:14 -0800, Geraldwho
<Geraldwho[ at ]discussions.microsoft.com> wrote:

[Quoted Text]
>i would like to have the default value for my Inspector field on my
>InspectionForm form come from my CompanyInfo table from a field called
>Definsp. Since this table only has 1 record, can i get this value and pass it
>on to the form control as a default value?

Set the textbox's DefaultValue property to

=DLookUp("Definsp", "CompanyInfo")
--

John W. Vinson [MVP]
Re: Default value on form coming from another table
Geraldwho 11/13/2008 10:54:10 PM
thanks. i got hung up with the syntax. (again)

"Damon Heron" wrote:

[Quoted Text]
> yourformcontrol= nz(dlookup("Definsp", "CompanyInfo"),0)
>
> check out dlookup in help.
>
> Damon
>
> "Geraldwho" <Geraldwho[ at ]discussions.microsoft.com> wrote in message
> news:7E65F183-571E-4A2E-9F04-60F04A240F30[ at ]microsoft.com...
> >i would like to have the default value for my Inspector field on my
> > InspectionForm form come from my CompanyInfo table from a field called
> > Definsp. Since this table only has 1 record, can i get this value and pass
> > it
> > on to the form control as a default value?
>
>
>

Home | Search | Terms | Imprint Contact
Newsgroups Reader - provided by WiredBox.Net