I have a database that allows the user to input a department code and
get all the employees within the department.
The table is generated from another script that places the numeric code
as a text field, which is fine.
My question is the following:
When I ask the user to input a department code, for example 8615, it
will bring up the report with the correct data, displaying the
department of "8615". However, if I use department code 2, it will
return all the correct data, displaying 2. I would like it to display
0002.
Is this possible? I played with the format function, but doesn't seem
to work since the filed is not numeric. 5 2277
> I have a database that allows the user to input a department code and get all the employees within the department.
The table is generated from another script that places the numeric code as a text field, which is fine.
My question is the following:
When I ask the user to input a department code, for example 8615, it will bring up the report with the correct data, displaying the department of "8615". However, if I use department code 2, it will return all the correct data, displaying 2. I would like it to display 0002.
Is this possible? I played with the format function, but doesn't seem to work since the filed is not numeric.
After you got the parameter from the user, you can "normalize" it to a 4-char
string, using the following instruction:
strParam = Right("0000" & strParam, 4)
Obviously, you may change it to suite your parameter desiderd length.
--
PBsoft di Gabriele Bertolucci www.pbsoft.it
skype: pbsoftsolution
where exactly would this be put? In the VB script of the submit button?
> where exactly would this be put? In the VB script of the submit button?
Sorry, but in your previous post you didn't speak about VBScript.
This is a Microsoft Access newsgroup.
Anyway, when the user clicks the button of the form, you may intercept that
event and, while parsing the form controls, I suppose you would assign controls
values to VBScript variables.
So, before assigning the value of the department code, you should use the
code I suggested you and only then sould assign it to the relative variable.
Issue: post any more question to a more appropriate group.
Bye.
--
PBsoft di Gabriele Bertolucci www.pbsoft.it
skype: pbsoftsolution
Gabriele Bertolucci wrote: where exactly would this be put? In the VB script of the submit button?
Sorry, but in your previous post you didn't speak about VBScript.
This is a Microsoft Access newsgroup.
Anyway, when the user clicks the button of the form, you may intercept that event and, while parsing the form controls, I suppose you would assign controls values to VBScript variables. So, before assigning the value of the department code, you should use the code I suggested you and only then sould assign it to the relative variable.
Issue: post any more question to a more appropriate group.
Bye.
-- PBsoft di Gabriele Bertolucci www.pbsoft.it skype: pbsoftsolution
Gabriele Bertolucci wrote: where exactly would this be put? In the VB script of the submit button?
Sorry, but in your previous post you didn't speak about VBScript.
This is a Microsoft Access newsgroup.
Anyway, when the user clicks the button of the form, you may intercept that event and, while parsing the form controls, I suppose you would assign controls values to VBScript variables. So, before assigning the value of the department code, you should use the code I suggested you and only then sould assign it to the relative variable.
Issue: post any more question to a more appropriate group.
Bye.
-- PBsoft di Gabriele Bertolucci www.pbsoft.it skype: pbsoftsolution
I used the wrong term. I thought the "code behind" in Microsoft Access
was called VBScript. My apologies...
This is a Microsoft Access question. I guess I should have asked, "Do
I put this in the code behind"? This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: david |
last post by:
Hi,
I have an application as follows:
MySQL database Back-Eend linked to MS Access Front-End and ASP Web
Application.
I require users to enter Serial Numbers such as:
0105123567 (10...
|
by: david |
last post by:
Hi,
I have 2 text boxes on an ASP form.
A user enters a Serial Number in TB1 such as 0105123456, presses tab to
move to TB2, TB2 then displays the value of TB1 after a calculation has
been...
|
by: Joshua Ammann |
last post by:
Hello,
I'm trying to export a query containing contact information, including a
field. Some zip codes have one or two leading zeros, for example,
San Juan, PR (00927) and Springfield, MA...
|
by: Urs Beeli |
last post by:
I have a question regarding errno. If I understand it correctly,
including <errno.h> allows me to check "errno" for error values
that some standard library functions may set.
This brings up some...
|
by: chris |
last post by:
Hi,
I have a simple ms access application that allows you to scan barcodes
in to a form which stores them in the database. The barcodes are 6
digits in length e.g. 555666 but my handheld...
|
by: GarryJones |
last post by:
I have code numbers in 2 fields from a table which correspond to month
and date.
(Month, Code number)
Field name = ml_mna
1
2
3
etc up to 12
(Data is entered without a leading zero)
|
by: Andrew Poulos |
last post by:
In my limited testing with FF 2, IE 6 and Opera 9 when I divided a
positive integer, that is less than 100, by 100 I get a leading zero in
front of the decimal point.
For example 80/100 gives...
|
by: bobm2005 |
last post by:
Whatever format I try in Printf, an 'E' format number nearly always
has a leading non-zero:-
1.2345E7
-9.3456E8 etc.
Is it possible to force it (printf) always to have leading zero?
...
|
by: JimmyKoolPantz |
last post by:
Task: Customer wants a script of the data that was processed in a
"CSV" file.
Problem: Zip-Code leading zeros are dropped
Basically we have a client that has requested a custom script for...
|
by: lornab |
last post by:
Good Afternoon
I need a column to show in a report as 10 digits long by adding zero's to the left of the result. My select statement is like this:
SELECT
a.client,
a.apar_id
FROM...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
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
|
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...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
|
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...
|
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: 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,...
| |