Dear all,
in a form, I have a subform which shows some information from a table.
in this subform, I have 3 fields, say for example, field1, field2, field3, which are in fact representatives of three fields in the table itself.
in the subform, I want to have a field that shows field1/field2/field3
So I created a new unbound field, and in the record source, I wrote: =field1 + "/" + field2 + "/" + field3
It is working, but it acts so slow. all the other fields are shown in the blink of an eye, but this field takes about 0.5 - 1 second to appear.
is there another way to do this faster?
17 1661
Hi,
one way would be to write a query having the Field1, Field 2 and Field3, then a fourth expression field which holds the new source as an expression which would equal the source you have for the Unbound control.
This should display a lot faster.
Hope this Helps
Leon
I am not so good in English. Can you please explain a little bit more?????? I don't get the image.
Apologies for being ambiguous.
From the Table you are using to populate the Subform, you want to write a new query.
Include all of the fields you require for this subform.
also, write a new "unbound" field (this is an expression)
call it something like myfield123
in this new field you place the source for the unbound control you have on the subform
[Field1] + "/" + [Field2] + "/" + [Field3]
save this new query and change the recordsource of the subform to the query you have just written.
also change the name of the control to the name of the field containing the expression.
This will replace the current recordsource with the recordsource you have been using, with the addition of the new field "myfield123" (or whatever you choose to name it) which will show the Contents of your example fields
Hope this helps
Leon
There are a few ways but could you please try the following before I give you a different solution.
If you are trying to divide your fields why not just put the following in your control source
=Field1/Field2/Field3
You do not need the "+" signs or all the quotes.
cheers, @Alireza355 NeoPa 32,556
Expert Mod 16PB @mshmyob
I tried that and got #Error for may pains. I use Access 2003.
@Ali,
Is your form used for updates?
If so, then your original version may be all you can use. The query method is a good idea just to show the data, but it will stop the recordset being updatable.
PS. Don't give up yet though. Mshmyob says there may be other approaches to try.
hmmm. Works fine in Access 2007.
Maybe replace the + signs with & then. If that doesn't work I will give you an other solution.
cheers, @NeoPa
The simply query won't make the subform read-only if it's based on a single table, will it, NeoPa? Then a calculated field of:
myfield: [field1] & "/" & [field2] & "/" & [field3]
Linq ;0)> NeoPa 32,556
Expert Mod 16PB
No Linq. You're right. It doesn't. My bad.
Access simply locks that particular field.
It would seem that is possibly an excellent solution then (see Leon's post #4).
Sorry, I seem to have posted be a mixture of t-SQL and MS Access :)
should have realised the ampersand... oops
Cheers
Leon
NeoPa 32,556
Expert Mod 16PB
That actually shouldn't be a problem Leon. See Using "&" and "+" in WHERE Clause.
It may be that & is preferred as you probably wouldn't want a Null value perpetuated, but it should work generally.
Cool,
You learn something new every day :)
Cheers
Leon
@Echidna
That's the beauty of MS Access!
Linq ;0>
I am not tring to divide. I just want to have a slash (/) sign between them:
alfa
beta
charlie
alfa/beta/charlie
:(
I don't understand,
I have tested the [field1] & "/" & [Field2] & "/" & [Field3] method within a select Query (see below) -
SELECT Table1.ID, Table1.Field1, Table1.Field2, Table1.Field3, [Field1] & "/" & [Field2] & "/" & [Field3] AS myfield123
-
FROM Table1;
-
the output generates what you are suggesting
Cheers
Leon
NeoPa 32,556
Expert Mod 16PB
Where are you stuck Ali.
I think the best answer (there are a few) is from post #4. All the answers are addressed to your question (none thought you were talking about division).
You can ignore some of the later comments. They're not specifically answers, just further discussion.
I got it!
I got it!
Sorry :(
Field1 + "/" + Field2 + "/" + field3 AS Myfield123
Does it perfectly.
Thanx a loooooooooooooooooooooooooooooooot.
no problem at all :), glad it worked, and glad I could help :)
Cheers
Leon
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Jose Gonzalez |
last post by:
How to apply a numeric format to a textbox using xhtml? I know you have to
use the "-wap-input-format" style tag in css. I can get this to work in a
regular xhtml page, however, I've been...
|
by: I am Sam |
last post by:
I have a DataGrid that is passing information to a stored procedure properly
but the parameters aren't being casted properly. I was woundering if anyone
can tell me how I should properly cast the...
|
by: Rich |
last post by:
Hello,
I have some datefields in a dataset (ds1). I bind some
textbox controls on a windows form to these date fields in
ds1, but I only want to see 01/01/2004 instead of 1/1/2004
8:00:00 AM. ...
|
by: MLH |
last post by:
I use A97. I've gotten used to reading values from textbox controls
on forms, I've come to rely on it pretty heavily. My habit spills over
into reports. I'm uncertain whether I can reliably read...
|
by: Adam Honek |
last post by:
I have a form.
It has serveral text boxes for user data entry.
I could of course write code to check if each is empty before proceeding to
save this data to a file.
Is there any global way...
|
by: Anonieko |
last post by:
Are there any javascript codes there?
Answer: Yes
On the PageLoad event call InitialClientControsl as follows
/// <summary>
/// This will add client-side event handlers for most of the...
|
by: nussu |
last post by:
Hi,
A textbox has to accept only numeric values by using validation controls in .net 2.0
Plz help me ...
Regards,
Nussu
|
by: JFKJr |
last post by:
Hello everyone, the following Access VBA code opens an excel file and creates textboxes in a given range of cells dynamically. The code attaches "MouseUP" and "Exit" events to the textboxes (using...
|
by: =?Utf-8?B?dHBhcmtzNjk=?= |
last post by:
OK I have some Chinese text in sql server column that looks like this:
12大专题调研破解广东科学发展难题
This is unicode? Anyway, I put this data into a text area like this:...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
| |