With microsofts article, I have made to store multi options value of a list box in a text box with comma. However, since these are IDs being stored, I want these values to run a query and get results also.
But I am confused since have never used comma like in query
INSERT INTO 1_2_06 ( Issue_ID, Assigned_To, ListType ) SELECT Issue_ID, Assigned_To, 'QPT' FROM QPTActions WHERE QPTActions.Entry_Date<=DateValue('1/2/2006') And QPTActions.Close_Date>DateValue('1/2/2006');
The Assigned_To values are a Lastname, Firstname format as they come out of the first database. But I need the comma stripped before they get entered into the INSERT database. Is it possible to do this on the fly?
I would like to remove the comma, but only one that is at the end of my string(there is a space after the comma, should be also removed).How should I do that in vba?
I have a table containing names. Unfortunately, the first and middle name are in the same field, and not all have middle names. I need to separate them out in a report. Is it possible to search the field and break at the first space?
I sometimes get a last name with two names not connected by a dash (i.e. Smith-Jones), instead it is entered as "Smith Jones". When I get it from Excel into Access is there a way to replace the space with an underscore in Access? I know I can do it in Excel, but I need that Excel file the way it is for other purposes.
So far I have a Multi Select enabled list on which the user selects the serial numbers they want. They then click the "Report" button which will trigger a query based on the selected serial numbers to create a report on those serial numbers.
I have the code for the multi-select list working already. It creates a string of comma separated values that are the serial numbers which are selected in the list. Somehow I need to pass this string to my query so it can use it as a filter.
Here is some of my code:
Code: Option Compare Database Option Explicit Private Sub Form_Current() Dim oItem As Variant Dim bFound As Boolean
[Code] ....
Here's my current query in SQL:
Then finally how to I get the query to execute and create a report based on all of this?
I am having an issue with some imports. As you will be able to see from the attached Db file, some fields import into MS Access with a leading space in front.
The problem is, Access doesn't seem to see it. For example, (in Query_1) I try to find the leading space with a Left and a Mid function using: " ", "", and Null... but none of these criteria match.
However if you use Left(string, 1)... the empty space will post. So my question is: How can I programmatically eliminate these leading spaces when I can't state if there is a leading space or not?
Does anyone know of a way that I can get rid of characters off a product code so all I am left with is just the characters greater than zero?
Example...
AA0000000652618... I only want to be left with 652618.
Would it be best to use a left trim or to use a right trim function? Unfortunately there is no standard for the product numbers... meaning that some numbers are 15 characters in length (as is above) but others maybe shorter or longer...
Also where I would add in the Right or Left Trim piece of code? Regards,
Tried to search for this, maybe I am searching the wrong term.
Anyways.. I have a table linked from a large mainframe, and what I am trying to do is trim any numbers that are 1 million and over, and still keep it a number.
I saw my question in an online tutorial once but can't find it.
I have about a thousand records and I'm just concerned about one field. I have to strip away part of the text.
Heres an example:
AFG-006/2/E AFG-006/E AFG-008/1 AFG-008/1/E
I have to strip away all of the left part from the ascii character (/)
so all the records would look like this:
AFG-006 AFG-006 AFG-008 AFG-008
I'm sure there's a way to do this with Trim, maybe Ltrim but I'm not sure how this would be done. Does anyone have any ideas. I have over 1000 records which means it wouldn't be practicle to do it manually.
I have used the Trim function in a query and am getting an error. At first I was concatanating several fields but have cut it back to the most basic form but still receive the error. The error says that the trim expression failed. Here is the code I used:
Hi all, I have a local table that has data imported from a spreadsheet and we have discovered that one of the fields brings in trailing spaces. Since the Access DB has some querys to manaipulate the data I thought I would just create a qry that would trim the value of that field but I am getting error messages when I try to run the query. Basically it is a update query with the field value written as:-
Code: Trim([Code])
I am leaving the update field in the qry blank and it complains about it not having a destination field which is understandable so how do I go about trimming the value of a field in a query. Is it even possible ?
I have a makeup query, were i am tryin to trim one of the fields, how ever i keep getting this message,
Extra ) in query expresion 'TemplLines..[Trim([ARTNR])].'
However in the field i have typed this "ProductNumber: Trim([ARTNR])" I cannot see were i am going wrong. I have included a print screen of my query any ideas.
I have a file that I split into little code files each with their own little Code and description. Now whoever the smart one was that is making these codes and descriptions has put double spaces between some descriptions and before and after some others.
Now in excel I don't have a problem removing them. I just use the good old Trim() function. But in access like most other programs the trim function just removes the leading and trailing spaces but leaves the double spaces inside the actual strings there.
Now my question is this. Is it possible to write a query or macro that would inspect each description and search for double spaces and either remove them if their on the end/beginning of a string or replace them with a single space if they are in the inside of a string.
Basically a search and replace function i guess is what im looking for here.
I have a field "DisplayURL" that contains values of various lengths. Some are only 12 or 13 characters long, but others are 50 characters long. I need to run an update query to "cut-off" all the characters past the 35 limit - so that all records in the field will be 35 characters or less.
I've searched this forum and online and there are similar posts but nothing quite like this, I thought it would be a trim function but I keep reading that it only removes spaces. Any ideas?
Hello, need help with the Trim() function. In a query I am using this SQL:
SELECT TRIM(tblAllMembers.First_Name), tblAllMembers.Middle_Name, TRIM(tblAllMembers.Last_Name), tblAllMembers.Address1, tblAllMembers.Address2, tblAllMembers.City, tblAllMembers.StateOrProvince, Trim(tblAllMembers.Postal_Code) FROM tblAllMembers WHERE (((tblAllMembers.City) Is Not Null) AND ((tblAllMembers.StateOrProvince) Is Not Null) AND ((tblAllMembers.Country)="USA"));
However when I run the query, the First_Name, Last_Name and Postal_Code doesn't trim leading and following blank spaces.
Here is my problem. I need the number that is at the end of EBF, sometimes there will be a dash some times a space, i know that I can use RIGHT to remove the first 4 characters, however I do not know where to place that in the above code.
My second issue is once I have the number only showing in the field I want to link that answer to a table that has a description of what that number represents.
The table name is Approval_Code. I want to have it do a VLookup type of function however that is not available in access. So I need to know how to get that result in a new field.
Hi all, this is my first post, I'll try and make it a good one :-)
System: Windows 2000 Office 2000
I have a small network of PC's here which have access to our central database. I have a simple form created using the label wizard which is used to print address labels for mailing lists. On most of the PC's here it works fine but on one or two (which have no obvious difference in thier setup) I get an "ODBC--Call Failed" error and it won't run the report???? I have puzzled over this for a while when I decided that I would remove the Trim function from the lines of the address fields on the label, these are put in automatically by the label wizard. This stopped the error message and the reports now run. I don't know why this is happening but I am hoping someone will.