473,396 Members | 1,997 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,396 software developers and data experts.

Displaying Combined the text of three fields on a form...

Hi,

I have three fields on a form, one that's manually entered, and the
other two drop down lists.

A combination of these three is put down on a physical file for quick
referencing. (I am aware this is not a very good database practice, but
nonetheless).

Thus the text on the file will read:

FileNo/Field2/Field3

I need this number to be displayed prominently as soon as the three
fields are filled in. This is how I went about it:

1. Made a text box on the form called "CombinedText".
2. When the field3 is updated, I set focus on the CombinedText text=box
3. Put a command:
combinedtext.text=Fileno+"/"+Field2.text+"/"+field3.text

However, I keep getting a "You can't reference a property or method for
a control unless the control has focus" error.

What do I do?

Thanks in advance,

Neil

Nov 13 '05 #1
4 1226
yeah, this is a really annoying problem isn't it??

try using the .Value property of the TextBox and ComboBox controls
instead.

Another way...set focus to each of those controls using Field2.SetFocus
before referencing the .Text property. I don't like that as much
because
you run into more problems, such as the .Text property doesn't actually
get set from certain events like OnEnter or OnKeyDown.

The technical explanation is:......Access is a piece of shit.

Nov 13 '05 #2
I also noticed that you used "+" for string concatination...a normal
Access .mdb file would prefer "&".

Nov 13 '05 #3

"Tommy T-Bag" <th***********@gmail.com> schreef in bericht news:11*********************@z14g2000cwz.googlegro ups.com...
Another way...set focus to each of those controls using Field2.SetFocus
before referencing the .Text property. I don't like that as much
because
you run into more problems, such as the .Text property doesn't actually
get set from certain events like OnEnter or OnKeyDown.

The technical explanation is:......Access is a piece of shit.


Don't judge too fast or someone here will do the same to you ...
If you don't know how to use the tools, then don't give 'technical' explanations like the above.

The OP needs to use the Change-event and use *only* the text-property of the 'current' control like:
Sub Field3_Change()
combinedtext = Fileno & "/" & Field2 & "/" & field3.text
End sub
Sub Fileno_Change()
combinedtext = Fileno.text & "/" & Field2 & "/" & field3
End sub
Same for Field2 ...

Arno R
Nov 13 '05 #4
The explanations I put work. I know how to use the tools just fine.

My objective opinion is that Access is in many, many ways inferior
to certain other Windows platforms. I am sure there are others in
this group who would agree.

My "technical explanation" is an example of something
called sarcasm.

Nov 13 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Matt K. | last post by:
Hi there, I have a form in an Access project that contains a subform which displays the results of a query of the style "select * from where = #a certain date#". In the main part of the form...
0
by: WindAndWaves | last post by:
Hi Gurus Here is another question that I have been struggling with for over a year. Basically, I would like to allow users to enter data into three tables in at the same time. The reason it...
9
by: Susan Bricker | last post by:
Greetings. I am having trouble populating text data that represents data in my table. Here's the setup: There is a People Table (name, address, phone, ...) peopleID = autonumber key There...
4
by: Krzysztof Bartosiewicz | last post by:
Hi! I haven't been using Access for a very long time and I forgot everything :) I will be very greatful for help since I have been fighting with this problem for a few hours... I have three...
9
by: Fish Womper | last post by:
I am at best a part time developer of Access databases. I use Access 2.0, as this is all my employer has on its computers. Even so, to use this ancient version requires a fairly convoluted...
1
by: NumberCruncher | last post by:
Hi All, I am struggling with setting up my first system of tables, forms,and reports, and could use your help! I am setting up a database to keep track of the production of a produced item. The...
8
by: Elfae | last post by:
I have searched high and low for a sample for this, and I just can't find any. Sorry for the length! Background Information The issue revolves around setting up a system-generated increase in...
1
by: littlealex | last post by:
IE6 not displaying text correctly - IE 7 & Firefox 3 are fine! Need some help with this as fairly new to CSS! In IE6 the text for the following page doesn't display properly - rather than being...
1
by: Arli | last post by:
I have the following linked tables: tblMainPL is my main table that I need to pull the information in from. It has the following fields: Autonumber1 -PK set as autonumber Date - short date...
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.