Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

TextBox Value again. . .

Status
Not open for further replies.

akaivyleaf

Programmer
Nov 1, 2000
42
US
Am I experiencing a problem with the brain today? I want to store a concatenated value of 3 text boxes into one text box. I can do it by changing the control source to the concatenated expression but when I go to write the expression in VBA on the afterupdate property it bombs every time. . .

Any suggestions for writing the vba to concatenate 3 text boxes into one?

Thanks in advance :)
 
Me![Text4] = Me![Text1] & Me![Text2] & Me![Text3]

Rick Sprague
 
That is what I did, and it doesn't work. My exact code in the afterupdate event is:
Forms!Project![Text66] = Forms!Project![FiscalYear]& Forms!Project![DivsionOffice]& Forms!Project![ProjectNumber]

The control source for Text66 is OITNumber.
 
If that is an exact cut and paste of your code, then I'd say your problem is that you haven't left a space before each "&". When "&" is attached to the end of a variable name, it's a type specifier meaning, umm, Long Integer, I think.

If the spacing is just an artifact of your copying the source code here, then you're going to have to explain what "it bombs every time" is supposed to mean. (When you're looking for technical help, technical jargon communicates much better than slang.) Rick Sprague
 
I added the spaces before the & and still no desirable results.

Pardon my use of 'slang', here follows a definition of what I mean when I say "it bombs every time".

When I use any of the examples of code written above, my database does not function when I save and compile all modules and go to the form view to see it work. I am able to go to my form view, type in the fiscal year, the division office and project number, and then my computer shuts off. Completely off. I have to turn on the computer from the power switch.

After rebooting, taking out the obviously offensive code, compacting and repairing my database, it works just fine. All of my other modules work fine, I'm not using anything to arrive at division office, or project number of fiscal year, they are pure data entry.
 
Are you serious? Your computer powers off when you execute this line of code?

I think you have a corrupted software problem. I would uninstall and reinstall Access (or Office) if I were you. That's the most bizarre behavior I've ever heard of!

There is nothing you can do in Access that should shut off your computer, short of deliberately declaring an API function and calling it. Even then, Access and Windows would shut down in a controlled way.

You might want to run an antivirus scan, too. I never heard of a virus acting like this, but I'm no expert on viruses. Rick Sprague
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top