473,769 Members | 2,222 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Highlight a line in a continuous form (& FindFirst)

62 New Member
I am trying to get a continuous form to highlight lines individually (ideally on hover). I have used the following code as recommended by a previous entry on this website. My problems begin in that my Database does not appear to recognise "FindFirst" . The sample database I downloaded for help does recognise the script and when I begin to type the drop down gives the prompt for "FindFirst" ! Why is it that my MDB does not? The only drop downprompt is "Find"

The code I am trying to work with is:
Expand|Select|Wrap|Line Numbers
  1. Function GetLineNumber()
  2. Dim RS As Recordset
  3. Dim CountLines
  4. Dim F As Form
  5. Dim KeyName As String
  6. Dim KeyValue
  7.  
  8. Set F = Form
  9. KeyName = "productid"
  10. KeyValue = [ProductID]
  11.  
  12.          On Error GoTo Err_GetLineNumber
  13.          Set RS = F.RecordsetClone
  14.          ' Find the current record.
  15.          Select Case RS.Fields(KeyName).Type
  16.             ' Find using numeric data type key value.
  17.             Case DB_INTEGER, DB_LONG, DB_CURRENCY, DB_SINGLE, _
  18.             DB_DOUBLE, DB_BYTE
  19.                RS.FindFirst "[" & KeyName & "] = " & KeyValue
  20.             ' Find using date data type key value.
  21.             Case DB_DATE
  22.                RS.FindFirst "[" & KeyName & "] = #" & KeyValue & "#"
  23.             ' Find using text data type key value.
  24.             Case DB_TEXT
  25.                RS.FindFirst "[" & KeyName & "] = '" & KeyValue & "'"
  26.                RS.F
  27.             Case Else
  28.             MsgBox "ERROR: Invalid key field data type!"
  29.                Exit Function
  30.                End Select
  31.          ' Loop backward, counting the lines.
  32.          Do Until RS.BOF
  33.             CountLines = CountLines + 1
  34.             RS.MovePrevious
  35.             Loop
  36. Bye_GetLineNumber:               ' Return the result.
  37.          GetLineNumber = CountLines
  38.          Exit Function
  39. Err_GetLineNumber:
  40.       CountLines = 0
  41.       Resume Bye_GetLineNumber
  42. End Function
  43.  
Any assistance please.
Aug 8 '07 #1
3 3280
JKing
1,206 Recognized Expert Top Contributor
I suppose we should start with the FindFirst issue. Check to make sure you have a reference to the Microsoft DAO 3.6 Object Library (or higher). To do this open the VBA editor and go to Tools > References then scroll through to find and check the library.
Aug 8 '07 #2
boliches
62 New Member
I suppose we should start with the FindFirst issue. Check to make sure you have a reference to the Microsoft DAO 3.6 Object Library (or higher). To do this open the VBA editor and go to Tools > References then scroll through to find and check the library.

Have done as suggested and added MS DAO 3.6 as well as Utility.mda but still I can only get "Find" when I start typing and enter a period (.) ie rs. producing a drop down list but sadly no FindFirst only "Find". I am sure there is a simple solution. Your help and knowledge is appreciated!
Aug 9 '07 #3
boliches
62 New Member
Have done as suggested and added MS DAO 3.6 as well as Utility.mda but still I can only get "Find" when I start typing and enter a period (.) ie rs. producing a drop down list but sadly no FindFirst only "Find". I am sure there is a simple solution. Your help and knowledge is appreciated!
Have since tried the following which has worked!

Dim rs AS DAO.recordset

This has enabled the FindFirst in the drop down list.

Thanks for the pointer.

Any other ideas on highlighting an individual line in a continuous form ideally on "hover"?
Aug 10 '07 #4

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

Similar topics

3
2069
by: Deano | last post by:
Here's a good one that keeps defeating me... I have a continuous form that has a date textbox as one of the controls. The user can choose any date they like including one they have already entered before. If the date they have just entered is already present I want to warn them and give them the option to keep the date or blank it. I couldn't get a dlookup to work for some unknown reason so now i'm looping through a recordset and the...
3
15852
by: Prakash Wadhwani | last post by:
Is there any EASY way to highlight a full row in a continuous form so that as i navigate up & down the table/continuous form using the arrow keys, the entire line (all fields) get highlighted ? This will give the effect of a bar moving up & down. BTW, all fields are locked so this form is View-Only & not editable. Thx & Best Rgds, Prakash.
2
8625
by: Steve K | last post by:
Firstly, how the heck does this guy do it? Writing reams of (awesome) code, debugging, responding to Newsgroups etc., all while commanding the ridiculous price of FREE?!?!?! More power to him! I'm hoping to use the Highlight Current Row functionality from the FormatbyCriteriaSubClass database. My problem is that the highlight is not scrolling. Selection rows works like a charm but the highlight doesn't move when I scroll. I am using...
3
15414
by: Typehigh | last post by:
I am a good programmer, but this one stumps me! I have a form with a continuous subform. The continuous subform contains records of data and may reach a depth of 1000's of entities. I have created a search button on my form and it does its job quite well. It presents the user with an inputbox, prompting for the string to search. Then the code returns with a record number of the record which contains the string. Here's the problem. I...
4
9164
by: neoman007 | last post by:
I have a form (frm_approval) which is based on a query (qry_unapproved). The query queries a table (tbl_total) for records that are unapproved and shows these records in (frm_approval) so the approver can use the form to approve them via checking a check box. The form is set to Continuous View and I get many rows of textboxes (RecordName & RecordQty), each row for 1 record to be approved. For every record, I have a checkbox field (chkbox) which...
3
11583
by: eighthman11 | last post by:
Using Access 2000. I have a continuous form which for simplicity sack has two fields Social Security Number and Last Name. In the header of the continuous form I have a textbox where you can type in any part of a social security number and when you do I want it to take the user to the closest match SSN record in the continuous form. For Example you have three records SSN LastName
2
1666
by: wassimdaccache | last post by:
Please help me Using access 2003 I do have a form (continuous) that expand for me all products in a table name " I made a in this form and it is unbounded What i need is a botton that on click i want to find any part of the field where the = ---> get the focus on it and highlight it
13
3458
by: eighthman11 | last post by:
using Access 2003 and sql server version 8.0 Hey everyone. Created a text box where the user types in an Inventory number and it takes them to that inventory number on the contimuous form. The form is based on a link table to sql server. Here is the code: Dim rst As DAO.Recordset Dim InventoryItem As String InventoryItem = "'" & "TextBoxValue" & "'"
2
4451
by: Steve | last post by:
I have a continuous form showing Product Code and Product Name. Product Code is five digits and is sequential. I have a textbox in the form header. What is the code to scroll the continuous form so that as I type in the the first two or three numbers of the product code in the textbox, the first product code record appears at the top of the form. I would like the continuous form to act like a combox with auto expand. Thanks!
0
9424
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
10223
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
9866
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...
1
7413
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6675
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();...
0
5310
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5448
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3968
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2815
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.