I would like to know if it is possible to concatenate two fields in a query and use a tab instead the normal space. It is possible? Thanks!
[Code]& tab??? &[Description]
I would like to know if it is possible to concatenate two fields in a query and use a tab instead the normal space. It is possible? Thanks!
[Code]& tab??? &[Description]
What happens when you try this?
I have not tried anything yet. I am searching for something to try? I don't want the word tab, I want a tabbed space so that my description column lines up evenly on the left. The code column is either 2 or 3 characters long, so if I just put spaces there, it does not line up. Thanks!
If you are looking for putting the tab character between the words, a tab is Chr(9)
Google "ASCII table" . In the table, look for Tab in the Char column...Code:[MyCode]& Chr(9) & [MyDescription]
No, it treats the Chr (9) like text it does nothing, my field get joined but not space or anything, it's like it just ignore the Chr (9). Any other suggestions.
OK, let's back up a minute..I don't want the word tab, I want a tabbed space so that my description column lines up evenly on the left. The code column is either 2 or 3 characters long, so if I just put spaces there, it does not line up
You want to concatenate two fields so they line up evenly? Is this on a form, report, word doc, text file????
Pretend you are in line at Burger King. I am behind you and I don't know anything about databases. Explain what you are trying to do.
Ok, I will try to explain better. I have this table with two fields or columns. I am creating a query for a drop down box on a form. I want the drop box to show the two fields together so when the users selects it from the list, it shows up on the form in one field. I am actually only storing the id to this record, but this is hidden from the user, they will see the actual name which has more meaning the them. Anyway, when I join the fields and you are looking at them in the drop box and after they are selected to show in the field, they look like this
AAB Description
AA Description
CCC Description
BB Description
See how the description does not line up evenly. If I could use a tab there instead of the spaces, it would look much neater and easier to read.
Like this
AA Description
BBB Description
Hope this explanation helps.
Why can't you just show the 2 fields (no concatenation)
They are text fields, so left justified in their own area.Code:AA Description BBB Description
You want the rowsource of your combo to be something like
Select id, field1, fieldDesc from Table....
Then in the format have widths 0";1",1" which will hide the ID, and display field1 and fieldDesc ( as 2 columns)
OK, I understand now. You can't use the tab character.. You will never get the columns to line up because the font is probably a proportional font.
You would need to set the font for the combo box control to something like Courier.
Then in the query, use
Formatting is:Code:SELECT YourTable.id, Left([MyCode] & " ",5) & [Description] AS Expr1 FROM YourTable;
Bound Column 1
Column Count 2
Column widths 0"
--------------------------------------
Had to change "[Code]" to "[MyCode]". Can't use the word "code" in the post![]()
upppppppppp ?ng h? ch? topic
Steve,
Now I get a syntax error, it seems it does not like the comma. If I take the comma out it tells me I am missing an operator.
So still not working. Thanks
Try this one (untested)
You can make x whatever you want (I'm still not sure what the goal is.)
SELECT YourTable.id, Trim([MyCode]) & Space(x) & Trim([Description]) AS Expr1 FROM YourTable;