PC Review


Reply
Thread Tools Rate Thread

Control with Dlookup source not showing data

 
 
SAC
Guest
Posts: n/a
 
      22nd Dec 2009
I have a forn with a textbox whose control source is dlookup...

When I open the form the control does not show any data. However, when I
click on the control the data is displayed.

Any ideas on how to make the data display when the form opens?

Thanks.

 
Reply With Quote
 
 
 
 
Allen Browne
Guest
Posts: n/a
 
      22nd Dec 2009
If the DLookup() expression depends on other controls on the form, chances
are that those values are not present early enough.

Use ReCalc to force the calculated expressions to update.

Either that, or get the data for the expression from somewhere independent
of the form.

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.


"SAC" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> I have a forn with a textbox whose control source is dlookup...
>
> When I open the form the control does not show any data. However, when I
> click on the control the data is displayed.
>
> Any ideas on how to make the data display when the form opens?
>
> Thanks.


 
Reply With Quote
 
SAC
Guest
Posts: n/a
 
      22nd Dec 2009
I'm not sure where to put the recalc. I put it in the on_current event as
me.recalc. I see the valuse briefly in the control then it goes blank.

Where can I put it so it'll work.

Thanks, Allen.

"Allen Browne" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> If the DLookup() expression depends on other controls on the form, chances
> are that those values are not present early enough.
>
> Use ReCalc to force the calculated expressions to update.
>
> Either that, or get the data for the expression from somewhere independent
> of the form.
>
> --
> Allen Browne - Microsoft MVP. Perth, Western Australia
> Tips for Access users - http://allenbrowne.com/tips.html
> Reply to group, rather than allenbrowne at mvps dot org.
>
>
> "SAC" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> I have a forn with a textbox whose control source is dlookup...
>>
>> When I open the form the control does not show any data. However, when I
>> click on the control the data is displayed.
>>
>> Any ideas on how to make the data display when the form opens?
>>
>> Thanks.

>


 
Reply With Quote
 
Allen Browne
Guest
Posts: n/a
 
      23rd Dec 2009
Agreed: Form_Current's not really a good idea. Form_Open and Form_Load are
probably too early, and Form_Activate is not good either.

Perhaps you could use an unbound text box, and assign it a value in
Form_Current.

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.


"SAC" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> I'm not sure where to put the recalc. I put it in the on_current event as
> me.recalc. I see the valuse briefly in the control then it goes blank.
>
> Where can I put it so it'll work.
>
> Thanks, Allen.
>
> "Allen Browne" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> If the DLookup() expression depends on other controls on the form,
>> chances are that those values are not present early enough.
>>
>> Use ReCalc to force the calculated expressions to update.
>>
>> Either that, or get the data for the expression from somewhere
>> independent of the form.
>>
>> --
>> Allen Browne - Microsoft MVP. Perth, Western Australia
>> Tips for Access users - http://allenbrowne.com/tips.html
>> Reply to group, rather than allenbrowne at mvps dot org.
>>
>>
>> "SAC" <(E-Mail Removed)> wrote in message
>> news:(E-Mail Removed)...
>>> I have a forn with a textbox whose control source is dlookup...
>>>
>>> When I open the form the control does not show any data. However, when
>>> I click on the control the data is displayed.
>>>
>>> Any ideas on how to make the data display when the form opens?
>>>
>>> Thanks.

>>

>

 
Reply With Quote
 
SAC
Guest
Posts: n/a
 
      28th Dec 2009
Excellent! I put the dlookup in the data source query. Works fine EXCEPT
the format.

The control on the form is formatted for Currency, but I'm getting several
decimal places. I changed the format for the column in the query and I'm
still getting the same result.

How can I fix this?

Thanks, again.

"Allen Browne" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> If the DLookup() expression depends on other controls on the form, chances
> are that those values are not present early enough.
>
> Use ReCalc to force the calculated expressions to update.
>
> Either that, or get the data for the expression from somewhere independent
> of the form.
>
> --
> Allen Browne - Microsoft MVP. Perth, Western Australia
> Tips for Access users - http://allenbrowne.com/tips.html
> Reply to group, rather than allenbrowne at mvps dot org.
>
>
> "SAC" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> I have a forn with a textbox whose control source is dlookup...
>>
>> When I open the form the control does not show any data. However, when I
>> click on the control the data is displayed.
>>
>> Any ideas on how to make the data display when the form opens?
>>
>> Thanks.

>


 
Reply With Quote
 
SAC
Guest
Posts: n/a
 
      28th Dec 2009
Never Nind. I got the formatting. I just used the format function in the
coloumn in the query and it works great.

Thanks for your help.

"SAC" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Excellent! I put the dlookup in the data source query. Works fine EXCEPT
> the format.
>
> The control on the form is formatted for Currency, but I'm getting several
> decimal places. I changed the format for the column in the query and I'm
> still getting the same result.
>
> How can I fix this?
>
> Thanks, again.
>
> "Allen Browne" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> If the DLookup() expression depends on other controls on the form,
>> chances are that those values are not present early enough.
>>
>> Use ReCalc to force the calculated expressions to update.
>>
>> Either that, or get the data for the expression from somewhere
>> independent of the form.
>>
>> --
>> Allen Browne - Microsoft MVP. Perth, Western Australia
>> Tips for Access users - http://allenbrowne.com/tips.html
>> Reply to group, rather than allenbrowne at mvps dot org.
>>
>>
>> "SAC" <(E-Mail Removed)> wrote in message
>> news:(E-Mail Removed)...
>>> I have a forn with a textbox whose control source is dlookup...
>>>
>>> When I open the form the control does not show any data. However, when
>>> I click on the control the data is displayed.
>>>
>>> Any ideas on how to make the data display when the form opens?
>>>
>>> Thanks.

>>

>


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Combobox control source - DLookup function Alan T Microsoft Access Forms 3 18th May 2007 12:41 AM
dlookup in Control Source on a textbox DartGuru Microsoft Access Form Coding 2 6th Nov 2006 02:46 PM
using dlookup as control source =?Utf-8?B?U0hBSEVFRA==?= Microsoft Access Form Coding 9 16th Apr 2005 09:16 PM
Repost - conditional DLookup control source =?Utf-8?B?UGF1bCBCLg==?= Microsoft Access Form Coding 2 17th Feb 2005 08:27 PM
Text Box with Control Source DLookup DanW Microsoft Access Forms 1 5th Sep 2003 07:15 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:17 PM.