473,473 Members | 2,219 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Form Searching

48 New Member
I am trying to create a search from a form but am having trouble getting data returned.

- I have a combo box, CboTitle Search that I select the criteria from.
- I have a search button, cmdSearch, that is looking through a query of submitted work when clicked.
- I want to compare what is selected in the combo box to the rows in the query and pull all the data in the query for the titles that match.
- I have tried creating a separate query for this process and using the OnClick Event Procedure to run it but I am not getting any results.
[SQL Query CODE]
Expand|Select|Wrap|Line Numbers
  1. SELECT Created_Submitted_Query.Title, Created_Submitted_Query.[Year Created], Created_Submitted_Query.Submitted, Created_Submitted_Query.[Submitted To], Created_Submitted_Query.Website, Created_Submitted_Query.Accepted, Created_Submitted_Query.Date, Created_Submitted_Query.Type
  2. FROM Created_Submitted_Query
  3. WHERE ((([Forms]![Records_Search]![CboTitleSearch])=[Created_Submitted_Query].[Title]))
  4. GROUP BY Created_Submitted_Query.Title, Created_Submitted_Query.[Year Created], Created_Submitted_Query.Submitted, Created_Submitted_Query.[Submitted To], Created_Submitted_Query.Website, Created_Submitted_Query.Accepted, Created_Submitted_Query.Date, Created_Submitted_Query.Type;
[SQL Query CODE]

Ultimately I would like to have the results appear as a sub-form on the bottom half of my search form instead of opening another screen. However, I can fight that battle later if necessary.

Unfortunately for me I am not a programmer and am just trying to teach myself how to do some things. Any help on this would be greatly appreciated.

Thanks,
Doug
Apr 18 '08 #1
2 1392
dougmeece
48 New Member
Hello,

I actually had the query, Records Search Query, retunring data now but only when I ran it direclty and not by using the command button. Here is the code for the command button.

[Command Button Code]
Expand|Select|Wrap|Line Numbers
  1. Private Sub CmdSearch_Click()
  2. On Error GoTo Err_CmdSearch_Click
  3.  
  4.     Dim stDocName As String
  5.  
  6.     stDocName = "Records Search Query"
  7.     DoCmd.OpenQuery stDocName, acNormal, acEdit
  8.  
  9.  
  10. Exit_CmdSearch_Click:
  11.     Exit Sub
  12.  
  13. Err_CmdSearch_Click:
  14.     MsgBox Err.Description
  15.     Resume Exit_CmdSearch_Click
  16.  
  17. End Sub
[Command Button Code]

Do I need an IF statement of soemthing in the code above? After testing it in the form again I started receiving no returns regardless of how I tried it. If I close Access and come back in I am again able to receive data back after getting prompted with a dialog box to enter a title.
Apr 18 '08 #2
NeoPa
32,556 Recognized Expert Moderator MVP
Doug, Your question seems a little complex. Check out Example Filtering on a Form and let us know if you're still having problems. Then, if we need to, we can go into more detail.

PS. Note the use of the [ CODE ] tags. They're required to show the code properly.
Apr 21 '08 #3

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

Similar topics

3
by: Harvey | last post by:
Hi, I try to write an asp query form that lets client search any text-string and display all pages in my web server that contain the text. I have IIS 6.0 on a server 2003. The MSDN site says...
11
by: Brian D | last post by:
I have been searching for a while to find an answer to this and I must be searching on the wrong keywords. Below is a snippet of my form. There are other form items on it, but I need to submit...
9
by: Christopher Koh | last post by:
I will make a form which will search the database (just like google interface) that will look/match for the exact name in the records of a given fieldname. Any suggestions on how to make the code?
3
by: jeff29_b | last post by:
I am having a strange problem on a web form. I have an image button with an OnClick event handler. When I click the image the event isn't being called in the code behind when browsing in firefox....
2
by: jodyblau | last post by:
I am trying to change the recordset that my form uses, but when I requery my form, all of the textboxes display #Name? Here is what I am trying to do: The user enters a search term in a textbox...
0
by: Howie | last post by:
Hi all. Hope you can help. I have created a form to edit existing records. I want to do two things: 1/ When the form opens, I want it to give a search field (searching on a string) which then...
11
by: TheDataGuy | last post by:
Using MS ACCESS 2002 I developed a FORM, and within that FORM, I created and added a SEARCH BUTTON, and then I created a SUB-FORM, so that when an the END USER clicks on the FORM it will POP-UP...
8
by: NMarks | last post by:
Hello all, I have created a database for my work that stores information for keys/locks, doors and employees. Specifically the database contains all the information of our lock system, which...
3
by: Michiel Rapati-Kekkonen | last post by:
I have a continuous form, with 22 rows on display. I make a change in some row and have the form requeried. (I have to, because the query on which the form is based is not updateable, and the...
0
by: Kassimu | last post by:
Hi guys out there, There is this database Iam creating, I have a table with 40 fields among which there are Date/time, Text, Number, Memo and Yes/No fields and I have created the form bound to that...
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
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
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
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,...
1
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...
0
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...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.