will not display my query

w0od0o

Registered User.
Local time
Today, 22:58
Joined
Jan 13, 2009
Messages
87
hi,
i am having problems displaying a query in a form,

i have created a query to show first and last names in the same text box and called this Names with
wholename: Clientdetails.[firstname] & " " & [lastname]
in the first blank field
query works fine when i run it

then ive added a text box to my form with the control source as
=[Names]![wholename]

but i get
#Name?
in the text box,

any help please

thanks
w0od0o
 
If the form is populated from the query then in that control all you need to put is ...

wholename

nothing else. In fact, you should be able to use the drop-down on the source of the control and see it appear in the list.

If the form is populated from something else - then you will probably need to do a DLookup.

-dk
 
hi,
i am having problems displaying a query in a form,

i have created a query to show first and last names in the same text box and called this Names with
wholename: Clientdetails.[firstname] & " " & [lastname]
in the first blank field
query works fine when i run it

then ive added a text box to my form with the control source as
=[Names]![wholename]

but i get
#Name?
in the text box,

any help please

thanks
w0od0o

The structure that you are using looks like you want to take the value from a Control named [wholename], not a query that is the Control Source for the Form. Try using =Names.wholename, or =wholename instead.
 
not to sure if im getting in a pickle here, =Names.wholename give me the same result,

would there need to be an assigned field in a table for the wholename results to be stored?

e.g. i have a table with first name and last name (with others, address ect), run the query using those 2, (works fine to here) create a form, add address, tel number ect from the table and create a text box for my results of the query

is this the correct way to do it or have i completely missed something?
 
not to sure if im getting in a pickle here, =Names.wholename give me the same result,

would there need to be an assigned field in a table for the wholename results to be stored?

e.g. i have a table with first name and last name (with others, address ect), run the query using those 2, (works fine to here) create a form, add address, tel number ect from the table and create a text box for my results of the query

is this the correct way to do it or have i completely missed something?

You said that wholename is a column in the QUERY that is the basis for the form. That means that the column name wholename can be used as a source for a Control in the form.
 
No, you're good. You will be able to edit the added fields but not the field you concantenated.

The control doesn't recognize the field. Check my first post to ensure that you can see the field through the control.

-dK
 
no there is only the field names of the table i originally created the forms with in the dropdown list of control,

if i create a new form with just the firstname lastname and wholename fields from the query it works fine

am i trying to do something thats impossible or maybe just stupid?

is it because the query only has the first, last and whole name fields and not all of the address ect?

please bare with me i am very new to this

thanks again
 
Go to the form. Bound the form to the query. Go to the control you want this to show up in. Open the properties for the control. Click on the Data tab. In the first row, Control Source, click the drop-down arrow to bring up all the fields in the query (that is bound to the form). Find "wholename". Click on it. Save Form. View Form.

If you don't see "wholename" in the list then your form is not bound properly or your concantenated field in the query is not called "wholename: [thisfield] & [thatfield]". Assign the form control whatever name is there.

As another option, you can leave the form bound to the table. In the control source of a form control you can use ... = [thisfield] & [thatfield] for the same effect.

Note, whichever method you use will render these fields uneditable; however, you will be able to edit the rest of the fields.


-dK
 
right......im getting somewhere but not to fast, although i am learning loads today and i thank you all for your help

i have bound the form to my query and i get a wholename drop down now but..........all my other details have change to #Name? so im assuming i have made a boo boo somewhere, now in my query rather than just having first, last and whole names, should i have all of the other field in there to (address, tel ect)?

w0od0o
 
The #Name? means the control can't see the field that you assigned it too. You have either not assigned those fields into the query that the form is bound to or you have changed the names of those fields in the query.

For instance ... I could have a [Address] field in a table. I could drag that field in a query and it would still be called Address, thus on the form control - the source would say "Address" and everything is peachy. However, in the query I could use ... MainAddress: [Address]. I would now need to refer to that field as "MainAddress" in the form control.

-dK
 
could i send u my db for you to have a sneaky peek? as i think i could get round it but would prefer to do it properly than to cut corners?
 
im happy to post it here no probs just dont want to take up to much of your time

shuld be attached :)
 

Attachments

thank you very much, i think i can see what youve done, you have addedd all the other fields to the query?

thanks again
 
Yes - that is what I did. I also renamed and added primary keys to the tables. All of the links I provided will help you on your journey and get you over the smaller hurdles.

Good luck!
-dK
 

Users who are viewing this thread

Back
Top Bottom