Trimming Characters
Feb 25, 2007
Good Morning to all
i would like to kindly ask if there is a pre defined function in the VBA SQL of access in which it will trim a certain field programmatically
for example
Old string = Manila-MSE Building - 30.26f
New String = Manila-MSE Building
Thanks for your help
View Replies
ADVERTISEMENT
Oct 21, 2005
My DB is on SQL Server with an Access adp front end.
SQL uses the Windows NT user name and password for security and also pulls in the user name into a field in every record so we know who has added and modified it.
For one table we are actually using the user name field on the form and in a report for reasons other than security.
The user name is filled in with first the name of the network group, then a slash, then the user name itself. So there are 7 characters I don't really care about.
Is there a way in VBA to remove those first seven characters and only show what comes afterwards? Thanks for the help!
View 3 Replies
View Related
Mar 21, 2007
I have a table that has about 5000 street addresses (ex. 1234 your st.). I want to get the all the characters until the first space. So for (1234 Your St.) I want to get 1234 for W1234 St I want W1234. Is this possible?
View 1 Replies
View Related
Aug 25, 2005
HI, i have a field in a query called [cost_type], these typically contains the values "principle works" or "additional works" how can i set the query up so that it doesn't return the "works" part of the record? Could i just return the first 10 characters of the result?
thanks
View 1 Replies
View Related
Oct 26, 2006
Another issue for my contacts database for work. I have a listbox on the edit contacts form that lists all contacts in the database.
The listbox rowsource is
SELECT [ContactID], [LastName] & ", " & [NamePrefix] & " " & [FirstName] & " " & [Business/Organization] FROM tblContacts ORDER BY [LastName] & ", " & [FirstName] & " " & [Business/Organization];
Some of the contacts that are businesses or organizations, do not actually have the first and last name filled in, just the business/organization name. So what happens in the list I get all of the entries that do not have FirstName/LastName at the top of the list, with the Business name following a few spaces. The way it looks is:
, Stop & Shop Supermarkets
But I would like to trim that beginning part if there is no FirstName/LastName so that Stop & Shop Supermarkets gets sorted with the S's, like this:
Stabile, Lisa
Stop & Shop Supermarkets
Stott, Joan
Is there something I need to put in the rowsource to accomplish this? I've searched these forums for an answer, and turned up no results.
Attached, I have a screenshot of the form with the listbox.
Thanks
ScrmingWhisprs
View 4 Replies
View Related
Jun 6, 2007
If I have a DB with several tables containing thousands of records, and most of those records only ever need say 8 characters, does anyone know if changing the field size from default 255 chars to 8 chars will actually benefits the the DB?
Potential benefits I'm thinking may occur are reduced filesize and maybe some speed?
View 3 Replies
View Related
Apr 15, 2014
I've got a piece of VBA scripting which runs as an event linked to a button on my MS Access form.
I maintain a database of members of staff at my organisation. It's pretty outdated...
I'm basically wanting to pull in their updated data (extracted from on our payroll system) from a spreadsheet, into a form, when clicking a button on a particular person's record.
This is what I have so far.
Code:
start = Forms!frm_main2!txt_start_row.Value - 1
conv = DDEInitiate("EXCEL", "Staff List.xlsx")
cell_employee_number = "R" & start & "C1"
cell_surname = "R" & start & "C2"
[Code] ....
The function "CStr(DDERequest())" converts the cell number into the readable data, however I seem to have whitespace below the value.
What would I need to do to strip out this whitespace? Would I use strtrim? If so, I am unsure of the syntax... how would I incorporate strtrim into the above?
View 7 Replies
View Related
Oct 3, 2006
My client is reporting corrupt characters cropping up in fields. These characters appear as Asian Characters. They only corrupt one record.
This happens very seldom. In fact, it hasn't happend for about 2 months and today it happend again. Their was no change to the database.
Is this a network problem? Network noise corrupting data?
Thanks
View 5 Replies
View Related
Feb 19, 2007
Hi
I want to ask something simple but because i am new i am dont know it!!! If you try to make queries in Access, untill how many characters you can put in each query???
View 14 Replies
View Related
Feb 21, 2007
Hello,
I am totally new at this database stuff. I have been searching the archives for a couple hours and confused on how to accomplish what I need to do. I saw references to using a module but I have not used that feature yet.
I am using Access 2003. I need to remove/delete " - " space dash space, "-" and "&" from a string in one field (DGName). I'm trying to do this with a make table query
DGName
P1000
P1000 - SMLS
P1000-CA (not a type error)
UD000 - C&B
V-NET
and I want it to come out like this
DGName
P1000
P1000SMLS
P1000CA
UD000CB
V-NET
Thanks
Sean
View 2 Replies
View Related
Mar 20, 2007
Hi, Everyone,
I have an excel column that has building location and building name in one column, example 1245 Accounting, how can I copy the 1245 into it's own column, please help, i can do it either in access or excel. Please.
View 3 Replies
View Related
Jan 24, 2005
users are using a hand held scan gun to enter data into a field. if the barcode is 12 characters long, I only want the 1st 7 to be written to the table.
I was thinking a validation rule using TRIM or LEN but can't seem to get it to work.
Any ideas?
Thanks
View 7 Replies
View Related
Jun 26, 2005
I am trying to write a query to extract the first 3 characters from a character string but have no idea where to start since we usually use Select "field" etc etc
Example, for a Code ACC01, the query result should give ACC
Would appeciated any guidance. Thank!
TK
View 3 Replies
View Related
Oct 6, 2005
I have several queries looking up products from a table. I use a simple form to access the query and in the criteria of the field I use [Forms]![EnterCroft]![ProductName] to filter by name. (EnterCroft is the name of the form).
It works fine but doesn't like the asterisk (*) for all products.
I also want to use wildcard before and after key words in the product names, eg *cup* for anything with CUP in it's name.
How can I do this?
Thank you very much.
View 2 Replies
View Related
Dec 20, 2005
Hello all. Have a bit of a strange one here (and fairly frustarting). I have a table which includes a field (type memo) which holds text comments.
I have a query which includes this field. For some reason, when the comments field is empty (identified thorugh opening the table), when it is returned through the query is shows two characters, namely '@v'.
Can anyone shed any light on this for me? Thanks for reading :)
View 2 Replies
View Related
Dec 18, 2007
I am sure there is an easier way fo doing this, but I am looking one at a time!!!
I want to know what is the Max and Min number of characters used in each field of my table.
I am using this code below, the max will be at the top and then scroll to the bottom to find the min, but as can be seen this is doing one field at a time and is very time consumining!
SELECT tbl05to06.Account, Len([Account]) AS MyAccount
FROM tbl05to06
ORDER BY Len([Index Key]) DESC , Len([Centre]) DESC , Len([Account]) DESC;
View 3 Replies
View Related
May 1, 2008
Hi,
I am trying to use a query to select the first two characters from a field I have created in a form. I would then like to use these 2 letters to filter out results in the query.
For example:
I have a number of sections in a document (1a - TAKE OFF, 1b - LANDING, 1c - STATIC etc.) which include associative chapters (1a.Contents, 1a.Introduction etc.).
From a combo box I select the section (i.e. 1a - TAKE OFF), I then want to filter out all the chapters in the associative section (i.e. 1a.Contents, 1a.Introduction etc) by using the first two characters of this combo box in the query.....
I hope this makes sense!!!
Cheers
View 2 Replies
View Related
May 1, 2008
Hi, i am looking to replace characters in a field using a query, I can use the replace to replace them all but that aint what I want e.g.
I want this: ~~test~test~~~~~test~~
To become this: test~test~test
I can use replace and get this testtesttest, but I need the ~ placed back between each word.
Any help appreciated, thanks:confused:
View 7 Replies
View Related
Feb 24, 2006
Hey everyone, I've been busy creating a switchboard based on database, and I came across this issue. When I put a search through records command button, it seems that I can't use the wildcard characters, such as *,%,_ in order to find multiple records matching my criteria.
Am I supposed to "enable" them from somewhere or am I doing something wrong.
Any help?
Thanx in advance
View 1 Replies
View Related
Oct 12, 2006
Is there a attribute for setting the max amount of characters in a textfield, I have thought about adding some code in the on keypress event, to lock the textfield once the required amount of characters has been reached, but I was hoping there would be a more simple way.
View 5 Replies
View Related
Jan 27, 2005
I just discovered that the report I am trying to create has too many characters in it. I have approximately 200 fields I am trying to get a sum for. Does anyone know the easiest way for me to get this sum with out typing in each field, ie., (1jbo)+(2jbo)+(3jbo). In Excel, we can just type in =sum(A:C) and it would just add them all up. That's what I need. Is there a way to add up all 200 items in a similar fashion?
View 1 Replies
View Related
Mar 5, 2004
I've discovered I have a problem sending text between an Access Database and ASP page.
The database contains Turkish characters (eg, i without a dot) and the output to a web page is fine when run on a server that has Turkey for its international settings. Interestingly, the database shows the correct data regardless of environment... just the written page that screws it up.
However when the same data and pages are used on an "English" server, the Turkish characters are lost and modifyed to their closest Western cousins.
I'm not sure whether this is exactly an Access or an ASP problem... I think it's the latter, but maybe someone reading this forum has som ideas too
Since I need to use this data in a server hosted in the UK, is there any code I can add which will fool the server into reading and writing the Turkish characters correctly?
Obviously, I could set up a function on the page to convert the characters, but that seems like a waste of system resources.
View 1 Replies
View Related
Aug 3, 2006
Hi everyone,
I have a DB that has over 180,000 records with zip code as one of the fields.
I would like to know how do you query the 1st 3 characters? For example, if zip is 95127, I want to query and retrieve records for the first 951.
I seen this on another thread, but can't find it. THanks in advance guys.
View 1 Replies
View Related
Jul 23, 2007
Hi guys,
I have a question regarding special characters that access doesn't like to see.
When passing a string to be absolved via html, if I set myHtmlBody = "<font color="#000FF"></font> it will throw a syntax error because of the # character.
How can I solve this? Thx for any help.
View 2 Replies
View Related
Feb 16, 2008
Hi
I wish to check my phone number fields for non-numeric characters.
If the field contains 0-9 then I want to keep the field otherwise I want to replace the contents with a null.
Can you please help?
Noel
View 2 Replies
View Related
Jan 16, 2006
Hi,
Simple question really (if you know your VBA)...
Have a field which contains records of strings of alphabetic characters i.e.
ADGHJLP
BCEFHIJKLMOPST
etc
Need to be able to separate these characters with a '/' so that the field reads
A/D/G/H/J/L/P
B/C/E/F/H/I/J/K/L/M/O/P/S/T
etc
I know it'll be a For..Next loop of some kind but can't seem to get the syntax correct.
Any help appreciated.
cheers,
Alex
View 4 Replies
View Related