I have the following VBA code to search for a string
Code:
'Search by Phone
Private Sub CmdSearchPhones_Click()
Me.Refresh
strSQL = "SELECT Tbl_Contacts.ContactID, Tbl_Contacts.FName, Tbl_Contacts.LName, Tbl_Contacts.Address, Tbl_Contacts.City, Tbl_Contacts.State, Tbl_Contacts.Zip, Tbl_Contacts.HomePhone, Tbl_Contacts.WorkPhone,
[Code] .....
My issue is that this works 50/50, because phone numbers on the database are NOW being stored in this format (000) 000-0000 and previous DB phone numbers got stored as 0000000000. The above code finds previous DB phone numbers (even if we dont enter all 10 digits) without a problem but has issues with new phone numbers stored in the new format UNLESS I specify the search with (000) 000-0000 (but we want to be able to search without adding that and without typing all 10 digits - in case we forget part of the number we are looking for)
How can I tell my query to find both formats, with the (000) 000-0000 AND 0000000000 ....
I have a mail merge from Access into Word that works great except for a baffling problem with phone number formatting. Instead of (987) 654-3210, on certain records the merge produces 9876543210. I cannot identify a pattern to explain it, but it is not random. Certain records consistently leave the format behind on the phone number, some on the fax number, and some on both. This problem is affecting about 1/3 of the contact records. I have the Input Mask on Phone and Fax in the table set to !(999") "000-0000;0;_. Is anyone familiar with this problem?
hi Iam new to this can anyone help i want to be able to enter phone numbers the code that ive found only seems to allow me to enter first 3 numbers were actually the areA code has 4 can any one give me correct formula
Greetings... I am setting up a text box to accept a phone number with an input mask of 000-000-0000;0;_ but it isnt doing quite what I want it to do, I would like it to start at the begining when clicked to prevent the error of a user typing in the number a space too far to the right. (right now it places the cursor where ever the user clicks, which becomes a major pain when you want to just be able to click the field anywhere and type from left to right for sake of speed)
I have a list of about 900 phone numbers, which have been formatted in excel to have a 0 at the beginning of the phone number. However when i export the data to access, so it can be viewed on a webpage this formatting is lost.
How best can i go about adding a zero at the beggining of all of the phone numbers in my list? Can it be done using sql or is there another function in access that can do this.
Ok I have an excel spreadsheet with over 6000 phone numbers that I need to import into a table. I have set up my field with an input mask to display a phone number as (xxx) xxx-xxxx. I have also set up my excel spreadsheet to have the numbers set up like 1234567890 to make it easy to throw in and let the input mask take over. My question is: I have some numbers that have an extension and are set up as 1234567890 x 102. I can take out the "x" and have all of the numbers run together, but what is the input mask syntax to have it display as say "(xxx) xxx-xxxx ext.xxx"?
I was about to post a question yesterday, but I found a solution myself and would like to share it. When a new column is computed in the query, there is no way to prescribe the data format of the computed column (=field =variable). It is done automatically by access and it can go wrong. I tried to use Format() function but it changes the look but does not change the type of the column. So what you have to do is to wrap your expression in a data convertion function. I used CDBL() as a wrapper for my expression.
I consider it as a bug of Access because in my situation I had a swich() function that took only numeric fields and produced only number but the data type of the column was set to TEXT. I noticed it in the pivot table later on , when I could only use Count() as aggregate function.
Good luck! and take care of data conversion by yourself, do not let it go automatically!
P.S. If anyone knows a better way to prevent such conversion errors, be my guest!!!
the phone rings.. the phone is connected to the computer.. the incoming caller's phone number is sent to the database.. and then possibly used in some way..(eg in a query or displayed on the screen in the database)
anyone had any experience in this process or can recommend a phone/cable setup url...
In Access 2002, I have a Phone Number field (Text) that is meant to store (obviously enough) phone numbers. However, when I enter 2009 as the last four digits (ex. (555)-555-2009) the number is changed to (555)-555-2010. This also occurs if I enter the number directly into the table (which doesn't have an input mask). I have tested it in a new form (even without input mask), and a new table, which both result in the exact same thing.
I'm currently trying to make a simple phone book database that use queries to search through the records. I need to set the search parameters to pick up all records containing a value rather that just search for that specific value.
For instance if I type in "mic" and search I want all records containing mic to appear in results like mick and Michael.
Is there any way this can be done?
So far I have only tried the [please enter first name] method and this has been in successful.
I am exporting data from access 2007 to Excel 2007 using VBA code. I have a whole number, which I want displayed as whole number. But after the export, the number is using the 1000's seperator in Excel. So for example if my original number in access table is 12000, it is showing up as 12,000 in the excel file.It has something to do with the NumberFormat property. I have tried doing this but doesn't work.
I have Set a Field as a Long Integer (and have tried Standard) Number with two decimal places. I enter data and it always displays as .00 and not the correct figures. Any clues anybody?
I have a query that looks like this, datediff("d",[end_date],[start_date])/30 it's working perfect, but it's give me a decimal number, how can I formate it to get rid of the decimals, if I put "m" instead of the "d" than this number won't be accurate, can someone help? thanks.
I am trying to enter a field with total hours for the day. I have set as "General number, 2 Decimal places. When I input the number [18.25] which means 18 and 1/4 hours..... The field will only display 18.00, I can not get it to show the .25.... I think the field is rounding off the number and if it is how do I get it to stop... I need this field to give me a sum in a report.... Need some help....
I need some input on what to use for a field that contains a range of IP addresses, and have it sort numerically by octet. I currently have that field assigned as text, but were not happy with the sort order. I've played a little with the number format type, but still did not get the correct sort order. Any suggestions would be appreciated. Thanks
I have been confronted with a strange fenomenon in comboboxes.
I'm working with access2000. I put a simple combobox in a form. The row source of the combobox is a table and the first field of this table is a number. The bound column is 1. When I select a record in the combobox, that number appears, it all seems to work.
However, when I reference the content of the combobox via a query, I receive strange characters. When I ask for the ASCII value of that character, it is mostly 49 (1) or 50(2). When I set the column width to zero, the references just work fine. When I change the format to text, everything works fine.
Can someone explain why this is happening?
I include a simple database to show what is happening. Look at the queries.
Hello, I have a text file I'm querying that stores a field as a text. ComponentID:0000000242
I'm inserting this data into a table that stores this value as a number. Thus truncating the leading zeros. ComponentID:242
I would like to create a query on the table using an InnerJoin on the text file column:ComponentID:0000000242 and the table column:ComponentID:242 as the unique identifier. Doing this join gives a case error because of the different data types.
Can format ComponentID using a query so it reads from my table as 0000000242 and do an InnerJoin to the text file. In vb String= Format(242, "0000000000") But I'm finding it difficult to get the query to format this correctly.
Unfortunately, i'm unable to change the column data type in the table structure and am looking for a work around. Is this even possible? Any ideas?