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

Set 'units' of controls, using another controls selection

I have a table, form and report set-up for an order form. One of the controls on the form allows currency selection from a combobox, three other controls are numerical controls for prices. Is it possible for the three price controls to take the currency selection from the currency selection control?

All help much appreciated.

Anton
Oct 23 '17 #1

✓ answered by NeoPa

You need to set the .Format property of the TextBox control on your form in that case.

NB. The escape character (\) must be used as Access recognises various different currency symbols simply to mean use the local one. Thus a format string of the following would be required :
Expand|Select|Wrap|Line Numbers
  1. "\£#,##0.00"

12 3716
PhilOfWalton
1,430 Expert 1GB
You are a little unclear in what you want.

Are yo saying that if the price is 12.34 you want to show it as
€12.34 if Euros have been selected
$12.34 if Dollars have been selectes
£12.34 if Sterling has been selected?

Phil
Oct 23 '17 #2
Exactly....is it possible? I am quite experienced now using Access but I am by no means an expert!
Oct 24 '17 #3
PhilOfWalton
1,430 Expert 1GB
Assuming the only field in your combo box is the currency symbol, and that is the bound column then something like this should work:-

Expand|Select|Wrap|Line Numbers
  1. StrPrice = MyComboBox & Format(MyPrice, "General Number")
  2.  
Phil
Oct 24 '17 #4
Thank you. I entered this code, withthe control names updated as belo:

Private Sub txtUnit_Price_AfterUpdate()
StrPrice = cboCurrency & Format(txtUnit_Price, "General Number")
End Sub

Unfortunately it didn't have any effect. Does the format of the cboCurrency combobox matter? Currently it is a number format because it is the currency ID number being stored in the field (of the underlying table) rather than the symbol itself. I guess that must stop your code working because the expression is not seing a symbol in the cboCurrency control!

I will try regenerating the structue with the currency symbol stored in the control/field.

Anton
Oct 25 '17 #5
PhilOfWalton
1,430 Expert 1GB
I has assumed (obviously incorrectly) that the CboCurrency was based on a table with a single field of the currency symbol.
If it is a 2 column combo box you may need to change the code to:-

Expand|Select|Wrap|Line Numbers
  1. StrPrice = cboCurrency.Column(1) & Format(txtUnit_Price, "General Number")
  2.  
The Column Number starts at 0 so if the RowSource look like this
Expand|Select|Wrap|Line Numbers
  1. CurrencyID    CurrencySymbol
  2.       1           £
  3.       2           €
  4.       3           $
  5.  
then the currency column is the second column (Column 1)

Phil
Oct 25 '17 #6
NeoPa
32,556 Expert Mod 16PB
Hi Anton.

Why don't you tell us what's in the table and how the ComboBox is populated. From that we can probably work out what you're trying to ask for and suggest a meaningful solution for you.
Oct 30 '17 #7
Hello, my appologies for leaving this reply so long, distractions.

The underlying table has ten fields, most are text entry-type. This problem concerns three of the tables fields, shown in the Tbl_Purchase_Order_Foundation_Level.jpg. I feed data into this table from Frm_Purchase_Order_Request, see Frm_Purchase_Order_Request.jpg, which also populates a report.

I am happy for the table to continue to show number format for the Unit_Price and Line_Value fields, but I would like the controls on the form and in the report to have a currency format. Currently £ is fixed in the controls format selection, but I would like the selection in the Currency control Combo box to govern the format of the Unit_Price and Line_Value controls.

I tried the code suggested but it wouldn't work for me, which I am sure is my fault rather than an issue with the code itself.

Anton


Attached Images
File Type: jpg Tbl_Purchase_Order_Foundation_Level.JPG (11.3 KB, 102 views)
File Type: jpg Frm_Purchase_Order_Request.JPG (13.2 KB, 114 views)
Nov 6 '17 #8
NeoPa
32,556 Expert Mod 16PB
Hi Anton.

Your pictures have so little background it's hard to see what's a table and what's a form. Your explanation doesn't make it any clearer. What exactly is your problem?
Nov 12 '17 #9
Good morning NeoPa,

I would like to select a currency symbol in one control, and have this currency symbol apply to two other controls. Referring to the jpg, Frm_Purchase_Order_Request (the form, which is tabular rather than columnar) I select £, $ or € in the 'Currency' control, and I would like the control 'Line Value' to have the same currency symbol shown.

Does that make sense?

Anton
Nov 13 '17 #10
NeoPa
32,556 Expert Mod 16PB
You need to set the .Format property of the TextBox control on your form in that case.

NB. The escape character (\) must be used as Access recognises various different currency symbols simply to mean use the local one. Thus a format string of the following would be required :
Expand|Select|Wrap|Line Numbers
  1. "\£#,##0.00"
Nov 13 '17 #11
Thank you very much.
Nov 14 '17 #12
NeoPa
32,556 Expert Mod 16PB
I'm glad I could help Anton :-)
Nov 15 '17 #13

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

Similar topics

1
by: Paul Eastabrook | last post by:
Hi, FormView & DetailsView are great controls in the new version of ASP.Net, but I am finding it tricky to display more than the record that either control is bound to at the time. For these...
1
by: itsme | last post by:
Hello Guys, I am trying to add server controls dynamically using XSL. I found an interesting article which shows how to add them dynamically onto the page. But in the article it says that one...
2
by: Amit Pandya | last post by:
Hi This is all using C# and i am new to it. I have a checkbox control that is added programmtically in the page_load event. Now on button click i want to retreive the checkbox control but i...
1
by: john | last post by:
I have two different problems: 1. When the user has clicked on a button that is causing the browser to post back to the server, it could take a little while for the new page to show up. So in...
3
by: Kezza | last post by:
Hi There.. I have dynamically created some textbox and checkbox controls by adding them to a panel. Now I would like to get the values out. I have created a for each loop that I can see the...
3
by: Mr Newbie | last post by:
I am messing around with Web User Controls at present and (think) I have discovered the following. 1.) The identifier for the control in the code behind must match the ID for the control on the...
2
by: Stu | last post by:
Hi, I have a javascript that needs to reference a server control (Listbox1) to check if an item is selected but the server controls are renamed '_ctl0:mainbody:Listbox1' when displayed in a...
5
by: njb35 | last post by:
Hi all I'm beginning my foray from VBA into VB 2005 Express, and enjoying some of the efficiencies it provides! I'm stuck with some dataset handling however that I _think_ can be automated but...
1
by: shapper | last post by:
Hello, I have an array of controls: Dim MyControls() As Control .... How can I add all the controls in MyControls array to a control collection? Thanks,
4
by: Nathan Sokalski | last post by:
I have a section of my code in which I need to know how many child controls a control has. Right now Controls.Count is returning the wrong value, which I realize is because Controls.IsSynchronized...
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: 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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
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.