473,725 Members | 2,254 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Combo-Box & FindFirst Problem !

I have a form (continuous) with a few fields :
First Name, Last Name, Policy Number, etc.

In the form footer I have a combo box for LastName which has 3 TEXT
fields: LastName, FirstName & Policy Number

When the user clicks a LastName on the Combo it should seek & position
me on that record on the continuous form. That's ok till here.

The problem is: It always position me on the 1st ocurence of the
LastName. Here's an example ...

L.Name F.Name Policy-Num
Astle Abbey 45
Bodey Art 56
Coelho Benny 87
Coelho Sebastian 33
Coelho Sebastian 34
Coelho Sebastian 35
Coelho Sebastian 36
Coelho Sebastian 37

Now, if I click on the 7th row Policy Number 36 (Coelho Sebastian), I
get positioned at Policy Number 87 (Coelho Benny).
Here's the SQL code for my combo box row source:
SELECT PMF.I_NAME_L, PMF.I_NAME_F, PMF.POLNO FROM PMF ORDER BY
PMF.I_NAME_L, PMF.I_NAME_F, PMF.POLNO;
Here's my combo-box Find Routine Code:

Private Sub Cmb_LName_Click ()
Me.OrderBy = "I_NAME_L, I_NAME_F"
Me.OrderByOn = True ' Putting it for safety JUST TO BE SURE

Dim rs As Object
Set rs = Me.Recordset.Cl one
rs.FindFirst "[I_NAME_L] = '" & Me.Cmb_LName.Co lumn(0) & "' and "
& _
"[I_NAME_F]= '" & Me.Cmb_LName.Co lumn(1) & "' and "
& _
"[POLNO]= '" & Me.Cmb_LName.Co lumn(2) & "'"
Me.Bookmark = rs.Bookmark

Me.I_NAME_L.Bac kColor = 16777088
End Sub
Can someone please point out what I'm doing wrong ? I'm sure it's
something very minor that I'm overlooking.

Thx & Best Rgds,
Prakash.
Nov 12 '05 #1
2 4110
Prakash,

I have had a similar issue also. See
http://www.google.nl/gr*************...e.nl&lr=&hl=nl
Apparantly the issue is fixed in A2k Sp3. At least I can't reproduce it anymore (just installed sp3)
In A97 I still can reproduce it (SR2)

It's 'something' with the scope of the column(x) property I think.

I am pretty sure the following works if you add this in your sub:
Dim txtColum0 as text
Dim txtColum1 as text
Dim txtColum2 as text
txtColumn0=Me.C mb_LName.Column (0)
txtColumn1=Me.C mb_LName.Column (1)
txtColumn2=Me.C mb_LName.Column (2)

Now if you will use there vars instead of the Column(x) property's then I think your code will work.

--
Hope this helps
Arno R



Nov 12 '05 #2
Hi Arno ... Thx !! I solved it a couple of hrs back but was waiting
for my post to show up on the NG. As you suggested, I did store the
value to variables & shifted some statements back & forth & got it to
work. BTW, I'm using AXP over WinXP. (I don't think it's a bug with
Access ... it seems to be a slight logic problem with my code).
Because I change the ORDER of the records, the bookmark also changes.
Here's the code ...
===== Code Snippet Starts Here =============== =============== ====

Private Sub Cmb_LName_Click ()
' DO NOT CHANGE THE ORDER of the statements in this routine.
' i.e. the variable names need to be stored 1st; then the ORDER BY
& then the FINDFIRST
'MsgBox (Me.Cmb_LName.C olumn(0))
'MsgBox (Me.Cmb_LName.C olumn(1))
'MsgBox (Me.Cmb_LName.C olumn(2))

Dim FName, LName, Pol_No As String
LName = Me.Cmb_LName.Co lumn(0)
FName = Me.Cmb_LName.Co lumn(1)
Pol_No = Me.Cmb_LName.Co lumn(2)

Me.OrderBy = "I_NAME_L, I_NAME_F, POLNO"
Me.OrderByOn = True ' Putting it for safety JUST TO BE SURE

Dim rs As Object
Set rs = Me.Recordset.Cl one
rs.FindFirst "[I_NAME_L] = '" & LName & "' and " & _
"[I_NAME_F]= '" & FName & "' and " & _
"[POLNO]= '" & Pol_No & "'"
Me.Bookmark = rs.Bookmark

Me.I_NAME_L.Bac kColor = 16777088
Me.I_NAME_F.Bac kColor = -2147483643 'White
End Sub

===== End of Code Snippet =============== =============== ===

Thx for your help & time ...
Best Rgds,
Prakash.


"Arno R" <ar************ ****@tiscali.nl > wrote in message news:<3f******* *************** @dreader2.news. tiscali.nl>...
Prakash,

I have had a similar issue also. See
http://www.google.nl/gr*************...e.nl&lr=&hl=nl
Apparantly the issue is fixed in A2k Sp3. At least I can't reproduce it anymore (just installed sp3)
In A97 I still can reproduce it (SR2)

It's 'something' with the scope of the column(x) property I think.

I am pretty sure the following works if you add this in your sub:
Dim txtColum0 as text
Dim txtColum1 as text
Dim txtColum2 as text
txtColumn0=Me.C mb_LName.Column (0)
txtColumn1=Me.C mb_LName.Column (1)
txtColumn2=Me.C mb_LName.Column (2)

Now if you will use there vars instead of the Column(x) property's then I think your code will work.

Nov 12 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
17215
by: Harry Haller | last post by:
<select name="cboPlaces" id="cboPlaces"> <option value="3">Countryside</option> <option value="4">Forest</option> <option value="5">Mountain</option> <option value="6">Desert</option> <option value="7">Jungle</option> <option value="7">Swamp</option> <option value="8">River</option> <option value="12">Town</option> <option value="9">Sea</option>
1
1768
by: Tina McGibben | last post by:
I basically have a form with a subform with two combo boxes on the main form which filter the subform. The code below works except I cant seem to get it to show all the worksheets when there is nothing in the buyer combo or status combo. Can someone please advise...thank you. For ease of naming:
8
6159
by: bbdata | last post by:
ok i have a problem here and not much time to play round. have a form bound to a table. one of the combos is bound to a field Agents. i have active and retired agents. thing is, i want to be able to retrieve all agents from the table, but to see only active in dropdown list of the combo, to asure accurate data entry. if i filter the agents table for a rowsource to get back only active in the dropdown, i cant retreive names of the rest when...
2
1484
by: Al | last post by:
hi,I am using asp.net(vb) I am trying to create 3 combo boxes which are dependable on each other. when comb1 is selected, it shows the comb2 data based on the selection in combo1 and when combo2 is selected, combo3 show data based on comb2 selection. in summary, I will end up having 3 combo boxes. I am not sure how to build such taks, I would appreciate your assitance. thanks Al
1
2916
by: Alejandro González | last post by:
Hi I have a combobox binded to a Datatable something like combo.DataSource = dt.DefaultView; combo.DisplayMember = "descField"; combo.ValueMember = "valueField"; it works fine.
2
1378
by: G .Net | last post by:
Hi Is there a way to prevent the combo displaying its list of items when the "combo arrow" is clicked? The problem I'm trying to resolve is that depending on a Boolean value, which is set according to other items on the form, I want to prevent the combo from being used. I suppose I could set the combo to be disabled but I'm wondering if there is something like
8
2201
by: AA Arens | last post by:
Hi I do have a products table and products-parts table in my Access 2003 database and log all services into a form. I do have at least the following two combo boxes on my form: - Choose Product where as the Row Source (See properties): SELECT tblProducts.ProductName, tblProducts.ProductName FROM tblProducts ORDER BY ProductName;
3
4747
by: John | last post by:
AC2007 I changed my combo's row source and then the autocomplete stopped working. The combo is two columns, bound to the first. First column is primary key (ID). Second column is a concatenation of two fields (Descrip & UserID). When I start typing letters of an existing description (Descrip), the combo does not autocomplete. If I select a choice from the combo, it
2
2156
by: Ruthenfods Tellez | last post by:
I have an application in asp; in my form I have a combo and a textbox, the combo is fill in from a database query. I cannot do the following: when selecting an item from the combo, it should send the ID of the combo to a textbox. In other words, when selecting an item, it must send the ID to a query and the result of this query send it to the textbox. I need to do this using vbscript and the onchange method. Please Help Me Thanks in...
4
1581
by: User | last post by:
Hi people, Excuse if my question is silly, but... i have 2 combo boxes in my project they are binded to fields from same table... one is binded do Code field and another to Description field i want to sincronize both...
0
8889
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8752
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9401
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9257
jinu1996
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9179
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9116
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6011
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
2
2637
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2157
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.