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 2279
> 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: 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: 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...
|
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,...
|
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...
|
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: 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...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
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: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |