473,406 Members | 2,281 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,406 software developers and data experts.

Search Textbox

2
I am trying to create a search field in a master form which will filter the results in a subform. My problem is that everytime I try to run the code I get an error time message "run time 424: Object Required." It appears that the reference to the subform as a record source is not correct but I have not been able to find out how to fix the issue. Since I am new at VBA I would appreciate any tips on how to fix the problem. The following is the VBA code that I am trying to use:

Private Sub cmdSearch_Click()
Dim LSQL As String
Dim LSearchString As String

If Len(txtsearchstring) = 0 Or IsNull(txtsearchstring) = True Then
MsgBox "You must enter a search string."

Else
LSearchString = textSearchString

'Filter Resuts based on search string
LSQL = "select * from AI_tbl"
LSQL = LSQL & "where ActionItems LIKE '*" & LSearchString & "*'"
Form_Item_sub.RecordSource = LSQL
lblTitle.Caption = "Action Item Details: Filtered by '" & LSearchString & "'"

'Clear search string
txtsearchstring = ""

MsgBox "Results have been filtered. All action items containing " & LSearchString & "."
End If

End Sub
Mar 20 '08 #1
1 1989
Polly
2
Disregard this question...after I hit my head on the wall enough times I finally saw that the "Has module" form property was set to no. I reset it to yes and it is working great.
Mar 20 '08 #2

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

Similar topics

8
by: Steph | last post by:
Hi. I'm very new to MS Access and have been presented with an Access database of contacts by my employer. I am trying to redesign the main form of the database so that a button entitled...
0
by: Arun Nair | last post by:
Hi, I have an Employerregistration pagethat is used to add new Empoyers to a table. I also have another form search.aspx used to search the employers(based on their id) and edit the employer...
1
by: ratnakarp | last post by:
Hi, I have a search text box. The user enters the value in the text box and click on enter button. In code behind on button click i'm writing the code to get the values from the database and...
1
by: Imran Aziz | last post by:
Hello All, I have an option of search on my web page coded as under <p>Search Bookmarks: <asp:TextBox ID="txtSearch" runat="server" class="texta" ></asp:TextBox><asp:Button ID="btnSearch"...
7
by: John | last post by:
hi, i have created a search form, and i want to search for a specific item in a field. e.g. i have a field called colour, which has record1 = 'red, blue, green' and another record2 = 'red' ...
3
by: Beany | last post by:
Hi, ive got 50% of the search engine working................. i have a textbox and a bigger textbox underneath it. The bigger textbox shows 3 fields (provider, site, tel with the rest hidden)...
1
by: vHTML | last post by:
hello everyone :) I am trying to make a page which would take a "entered" on search query from the previous page and display results in google with that query in an <iframe> in the results.htm...
6
by: cassey14 | last post by:
Hi i hope someone help me on this..Im doing a search form..In my search form I have 7 fields to search these are: caseID case Summary Resolution Summary Status Summary Escalated To Date...
5
by: Dave Rado | last post by:
Hi I have been the following code by Freefind to use on my search page: <form action="http://search.freefind.com/find.html" method="get" accept-charset="utf-8" target="_self"> <input...
9
by: weirdguy | last post by:
Hello, Just for anyone information, there is a similar title "Search in Listbox" but it is via Combo Box. In case, anyone need it, I put a link to here. Please let me know if I break any rules...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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
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...
0
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.