Solved

seeking in a data control DB

Posted on 1998-06-12
6
140 Views
Last Modified: 2012-05-04
I am using VB 4 to make a front end for an Excel database.  The front end is read only and the user is allowed to scroll through the entries and search for particular fields.  I am using a data control and binding labels to the appropriate fields.  How can I allow the user to search for X in fieldY?
0
Comment
Question by:BoB
  • 3
  • 3
6 Comments
 
LVL 6

Expert Comment

by:clifABB
ID: 1463194
If X is a numeric value:
Data1.Recordset.FindFirst "fieldY = X"
If X is a text value:
Data1.Recordset.FindFirst "fieldY = 'X'"
0
 

Author Comment

by:BoB
ID: 1463195
This command gives me error 3251 "Feature not available."  Any other suggestions?

0
 
LVL 6

Expert Comment

by:clifABB
ID: 1463196
Change the RecordsetType on your Data Control from 0 - Table to 1 - Dynaset
0
Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

 

Author Comment

by:BoB
ID: 1463197
Bingo!
0
 
LVL 6

Accepted Solution

by:
clifABB earned 50 total points
ID: 1463198
Let's see...
Name of a dog in children's songs.  :)

I will assume I can resubmit for points.

If X is a numeric value:
Data1.Recordset.FindFirst "fieldY = X"
If X is a text value:
Data1.Recordset.FindFirst "fieldY = 'X'"

Change the RecordsetType on your Data Control from 0 - Table to 1 - Dynaset
0
 

Author Comment

by:BoB
ID: 1463199
Thanks
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
VBS file using code from 2nd file (txt or vbs) 4 36
Export Data to Different .csv Files 26 104
Automatic Email Reminder 4 37
Sub or Function is not defined 6 28
Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question