473,398 Members | 2,113 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,398 software developers and data experts.

Trying to combine a field value and a string

I have a field called Order No, I want its value to be a combination of this
string "P000" and the value of the [Transaction number]. I tried this:

[Order No] = [Transaction Number]
Or

[Order No] = "P000"

If I want to combine the two values what is the VBA function for it

I tried the following

[Order No] = "P000" + [Transaction Number]
[Order No] = "P000" And [Transaction Number]
[Order No] = "P000" & [Transaction Number]
[Order No] = "P000" , [Transaction Number]

They all give me error messages, I know it's a simple thing but I know very
little about vba any help?

Thanks guys
Nov 13 '05 #1
2 5786
Where are you trying this?

You could put the 3rd one into the AfterUpdate event procedure of
Transaction Number.

However, if the value should *always* be P000 and the transaction number,
you don't need a field for it at all. You could just set the Control Source
of your text box to:
="P000" & [Transaction Number]

More info on when and how to use calculated fields:
http://allenbrowne.com/casu-14.html

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Paolo" <pr*****@netspace.net.au> wrote in message
news:d0***********@otis.netspace.net.au...
I have a field called Order No, I want its value to be a combination of
this string "P000" and the value of the [Transaction number]. I tried this:

[Order No] = [Transaction Number]
Or

[Order No] = "P000"

If I want to combine the two values what is the VBA function for it

I tried the following

[Order No] = "P000" + [Transaction Number]
[Order No] = "P000" And [Transaction Number]
[Order No] = "P000" & [Transaction Number]
[Order No] = "P000" , [Transaction Number]

They all give me error messages, I know it's a simple thing but I know
very little about vba any help?

Thanks guys

Nov 13 '05 #2
It worked with the & the second time thank you
"Allen Browne" <Al*********@SeeSig.Invalid> wrote in message
news:42**********************@per-qv1-newsreader-01.iinet.net.au...
Where are you trying this?

You could put the 3rd one into the AfterUpdate event procedure of
Transaction Number.

However, if the value should *always* be P000 and the transaction number,
you don't need a field for it at all. You could just set the Control
Source of your text box to:
="P000" & [Transaction Number]

More info on when and how to use calculated fields:
http://allenbrowne.com/casu-14.html

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Paolo" <pr*****@netspace.net.au> wrote in message
news:d0***********@otis.netspace.net.au...
I have a field called Order No, I want its value to be a combination of
this string "P000" and the value of the [Transaction number]. I tried
this:

[Order No] = [Transaction Number]
Or

[Order No] = "P000"

If I want to combine the two values what is the VBA function for it

I tried the following

[Order No] = "P000" + [Transaction Number]
[Order No] = "P000" And [Transaction Number]
[Order No] = "P000" & [Transaction Number]
[Order No] = "P000" , [Transaction Number]

They all give me error messages, I know it's a simple thing but I know
very little about vba any help?

Thanks guys


Nov 13 '05 #3

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

Similar topics

3
by: mmccaws | last post by:
Thanks ahead for your help I'm trying to learn what I can do with echo and print statements. I figured out the echo statement and below is the simple version using print. I've tried two dozen...
0
by: David Elliott | last post by:
I am looking to use a field attribute in a to find and use a property. If given Find("Record Artist", "Billy Joel"); I am looking to find the first instance in the collection where the value the...
4
by: MichaelD | last post by:
Hi! How do I combine an element pattern with attributes? I can validate <phone>111-111-1111</phone> using pattern
8
by: mark | last post by:
Access2000 How do I write a query that combines the CTC field from each record below into one record? I need to concatenate the CTC field with a separator, like below: ...
25
by: Neo Geshel | last post by:
This works: <form> <asp:TextBox id="name" /> <%= name.ClientID %> </form> But this DOES NOT work: <form>
22
by: RSH | last post by:
Hi, I have been reading on interfaces working on samples I've run across on the web. For the life of me I cannot seem to grasp them. It appears to me that interfaces are simply blueprints to...
7
by: Mintyman | last post by:
Hi, I'm working on a system migration and I need to combine data from multiple rows (with the same ID) into one comma separated string. This is how the data is at the moment: Company_ID ...
3
by: Steven Bethard | last post by:
Within a larger pyparsing grammar, I have something that looks like:: wsj/00/wsj_0003.mrg When parsing this, I'd like to keep around both the full string, and the AAA_NNNN substring of it, so...
1
by: David C | last post by:
I have a DataList that displays photos and is bound to a list of files. Is there a way to combine the value of a variable (strpath) with the # Bind(...) in the ImageURL field. Below is what I...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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?
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
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.