473,387 Members | 1,493 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Textbox format

Alireza355
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?
Apr 27 '09 #1
17 1661
Echidna
53
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
Apr 27 '09 #2
I am not so good in English. Can you please explain a little bit more?????? I don't get the image.
Apr 27 '09 #3
Echidna
53
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
Apr 27 '09 #4
mshmyob
904 Expert 512MB
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
Apr 27 '09 #5
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.
Apr 27 '09 #6
mshmyob
904 Expert 512MB
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
Apr 27 '09 #7
missinglinq
3,532 Expert 2GB
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)>
Apr 27 '09 #8
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).
Apr 27 '09 #9
Echidna
53
Sorry, I seem to have posted be a mixture of t-SQL and MS Access :)

should have realised the ampersand... oops

Cheers

Leon
Apr 27 '09 #10
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.
Apr 27 '09 #11
Echidna
53
Cool,

You learn something new every day :)

Cheers

Leon
Apr 27 '09 #12
missinglinq
3,532 Expert 2GB
@Echidna
That's the beauty of MS Access!

Linq ;0>
Apr 27 '09 #13
I am not tring to divide. I just want to have a slash (/) sign between them:

alfa
beta
charlie

alfa/beta/charlie

:(
Apr 28 '09 #14
Echidna
53
I don't understand,

I have tested the [field1] & "/" & [Field2] & "/" & [Field3] method within a select Query (see below)

Expand|Select|Wrap|Line Numbers
  1. SELECT Table1.ID, Table1.Field1, Table1.Field2, Table1.Field3, [Field1] & "/" & [Field2] & "/" & [Field3] AS myfield123
  2. FROM Table1;
  3.  
the output generates what you are suggesting

Cheers

Leon
Apr 28 '09 #15
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.
Apr 28 '09 #16
I got it!
I got it!

Sorry :(

Field1 + "/" + Field2 + "/" + field3 AS Myfield123

Does it perfectly.

Thanx a loooooooooooooooooooooooooooooooot.
Apr 29 '09 #17
Echidna
53
no problem at all :), glad it worked, and glad I could help :)

Cheers

Leon
Apr 29 '09 #18

Sign in to post your reply or Sign up for a free account.

Similar topics

1
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...
7
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...
1
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. ...
14
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...
2
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...
0
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...
2
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
1
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...
9
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:...
0
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,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
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...
0
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...
0
BarryA
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
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...
0
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...
0
marktang
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,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.