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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
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
|
|||
|
|||
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 | |
|
|