473,416 Members | 1,696 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,416 software developers and data experts.

Access 2000 OnChange Event ignores a space

I am using MS Access 2000 on a Windows XP machine.

I have a list form, listing the number of companies a business is dealing with. I have a filter field on the form which is used to filter the list as characters are typed in the filter field, using the OnChange event for the field.

Generally the filter works fine except when a company name contains a space. The space seems to get ignored in the code for the OnChange event. Ihave checked the field length of the text entered and the last character. The space is there before the filter is performed. After the filter is completed the space seems to be dropped from the filter field. If another character is typed in the field it sits right behind the last character before the space. Therefore, the filter no longer works properly.

This is the code used in the OnChange event:

Me.Filter = "[Supplier Name] Like '" & SupplierFilter.text & "*'"
Me.FilterOn = True
Me!RecCount = Forms![frm Payables List].RecordsetClone.RecordCount
If Me!RecCount = 0 Then ' Checks for empty filter result
Exit Sub
Else
SupplierFilter.SelStart = 10 ' Position to the last good character
End If

Any help that anyone could offer is much appreciated, even if only to confirm that a blank cannot be part of a filter.
Mar 14 '07 #1
1 2514
MMcCarthy
14,534 Expert Mod 8TB
Try this ...
Expand|Select|Wrap|Line Numbers
  1. Me.Filter = "[Supplier Name] Like '" & Me!SupplierFilter.Value & "*'"
  2. Me.FilterOn = True
  3. Me!RecCount = Forms![frm Payables List].RecordsetClone.RecordCount
  4.     If Me!RecCount = 0 Then         ' Checks for empty filter result
  5.    Exit Sub
  6. Else
  7.    SupplierFilter.SelStart = 10  ' Position to the last good character
  8. End If
  9.  
Mary
Mar 17 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: calfdog | last post by:
Hello, Does anyone know a workaround for calling fireEvent. With the latest from Microsoft OS XP2 and Hot fixes to IE it now gives an "access denied" error in Python when called. Here is what...
2
by: Matt | last post by:
The following code won't work, because onchange event is not trigger when drop down size = 1. But if I make the size="2" or greater, then it will work. Is that true? please advise. thanks!! ...
6
by: Peter Frost | last post by:
Please help I don't know if this is possible but what I would really like to do is to use On Error Goto to capture the code that is being executed when an error occurs. Any help would be much...
7
by: dog | last post by:
I've seen plenty of articles on this topic but none of them have been able to solve my problem. I am working with an Access 97 database on an NT4.0 machine, which has many Access reports. I...
11
by: Grasshopper | last post by:
Hi, I am automating Access reports to PDF using PDF Writer 6.0. I've created a DTS package to run the reports and schedule a job to run this DTS package. If I PC Anywhere into the server on...
4
by: Rick | last post by:
Please Help. I have a tab control with 4 tabs. When a tab is selected, I want to "do stuff". I thought to just do this: Usint the tabControls OnChange event If MyTabControl.Value = 0 then (the...
7
by: manning_news | last post by:
I've got a report that's not sorting correctly. I build a SQL statement and assign it to the recordsource in the Open event, sorting the data the way the user chooses. The user can choose up to 3...
17
by: tommy | last post by:
Hi all, I' m adding strings to some fields in my table via Access. The strings sometimes have trailing spaces and I really need to have it that way, but Access truncates trailing spaces. How can...
3
by: lowslyn | last post by:
hi, can someone please help me with javascript... i have this code that checks a text field when the user overrides the value to blank/space. if it is blank/space, i need to change the value...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
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...
0
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...
0
marktang
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,...
0
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...
0
Oralloy
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,...
0
tracyyun
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...
0
isladogs
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...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.