A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Default value fill with SQL query result



 
 
Thread Tools Display Modes
  #1  
Old August 14th, 2006, 05:30 PM posted to microsoft.public.access.forms
zoltar
external usenet poster
 
Posts: 2
Default Default value fill with SQL query result

Hi,
I am trying to set the default value of a text box using a SQL query
which depends on the result of a combo box selection made in a
previous form. But all I get is '#Name?' in the text box.

I have created a SQL query called Q1 which is:
SELECT [client].[name]
FROM client
WHERE clientid=[Forms]![Choose Client]![Combo4];

And then in the 'Default value' for the text box I have put:
=[Q1]

Am I doing this the wrong way? The 'Combo4' is the combo box on the
previous form from which the text box should be set.

thanks for any help.

  #2  
Old August 14th, 2006, 05:38 PM posted to microsoft.public.access.forms
Allen Browne
external usenet poster
 
Posts: 11,706
Default Default value fill with SQL query result

No, that's not going to work.

See:
Carry current value of a control to new records
at:
http://www.mvps.org/access/forms/frm0012.htm

--
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.

"zoltar" wrote in message
oups.com...
Hi,
I am trying to set the default value of a text box using a SQL query
which depends on the result of a combo box selection made in a
previous form. But all I get is '#Name?' in the text box.

I have created a SQL query called Q1 which is:
SELECT [client].[name]
FROM client
WHERE clientid=[Forms]![Choose Client]![Combo4];

And then in the 'Default value' for the text box I have put:
=[Q1]

Am I doing this the wrong way? The 'Combo4' is the combo box on the
previous form from which the text box should be set.

thanks for any help.



 




Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 09:40 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.