473,608 Members | 2,592 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Combo box Search Problem

67 New Member
Hello all

I am trying to create a search form. I have a table called tblContact which has the field for postcodes in it. I have another table called tblSales which i have created a query to link the tblContacts to. On the frmSales the Postcode is a combo box. I am using the code below to search for the postcodes. I can't get it to find a postcode via the combo box. Sorry if i am not being very clear as my coding is very basic. Please help, thanks.


Private Sub btnSearch_Click ()
Dim strSearch As String

If IsNull(Me![PostcodeSearch]) Or (Me![PostcodeSearch]) = "" Then
MsgBox "You Must Enter A Postcode!", vbOKOnly, "Invalid Search!"
Me![PostcodeSearch].SetFocus
Exit Sub
End If

DoCmd.ShowAllRe cords
DoCmd.GoToContr ol ("Postcode")
DoCmd.FindRecor d Me!PostcodeSear ch

Postcode.SetFoc us
strPostcodeRef = Postcode.Text
PostcodeSearch. SetFocus
strSearch = PostcodeSearch. Text

If strPostcodeRef = strSearch Then
MsgBox "Match Found For: " & strSearch, , "Match Found!"
Postcode.SetFoc us
PostcodeSearch = ""

Else
MsgBox "No Match For: " & strSearch & " - Please Try Again.", _
, "No Match Found!"
PostcodeSearch. SetFocus
End If
End Sub
Oct 2 '08 #1
1 1834
Wayneyh
67 New Member
Hi again

The problem isn't the combo box as when i link the tblContact direct to the control source it works fine. so its linking through a query where i am having the trouble. Please advise. Regards
Oct 2 '08 #2

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

Similar topics

3
2004
by: NB | last post by:
Let's say in the product table I have around 50,000 products (well, infact it has now about 2000 only, but it's growing very fast, hence the question here) In the order form, users will select the product for the order lines. They want to see the entire list of available products. You can't handle the combo the way you've heard: limiting rowsource until first few characters entered, because - the product primary key is an autonumber
1
4145
by: Jeff Smith | last post by:
Hi This is a repost due to no responses Here's a problem I've encountered with Access 2003 which has got me to redesign how I get the row source in a second combo box using the first combo box as a filter. In Access 2002 and earlier the row source for the second combo was "SELECT Field1, Field2 etc, FROM MyTable WHERE Field3 =
1
6150
by: Will | last post by:
I have a combo box on a form which is based on table tblMachine. On that combo box I have four columns visible MachineNumber, description, location and type. The bound column is the MachineNumber and this is not set to 0 as the machines have its number on which means the user should know the machine number. My problem is if the user doesn't know the number. I have a button which changes the row source of the combo box to order by...
4
3686
by: Lauren Wilson | last post by:
A2K I have a combo box that shows the content of a last name field from a table. I use it to locate records in the table form. I can open the form and locate several names quickly by placing the cursor inside the drop-down list and typing the first few letters of the name I want to find. Then, for no apparent reason, the list just stops responding to subsequent searches for names that I KNOW are in the list. The list contains no...
6
3747
by: Ron L | last post by:
I have a dataset whose source is a SQL 2k stored procedure that I am trying to display in a datagrid. This datasource has 4 columns that I am interested in here, a text column and 3 value columns corresponding to permissions to certain data classes. I want to put the permission values in combo boxes in the grid and instead of displaying the numeric values, have the combo box display a string that corresponds to the numeric value (i.e. No...
2
4017
by: Damon Cherne | last post by:
Here is my issue. I have created a form called “Search” that has several unbound combo boxes, one for each of the attribute that match a column in the Table . Each combo box has input from a separate table that limits what the uses can select. IE. The Genre table feeds a list of options for the Genre combo box. My goal is to have the user select the attributes they want to use as search criteria and then feed those selections from the...
3
2468
by: mf193 | last post by:
Hi, I have a table of around 1000 rows; patient records. Each row is individually defined by a Patient ID number which is my primary key. I have made a simple form to display patient information for the secretaries working in the office. I would like them to be able to easily search through all the records using a combo box, that they can just type in the person's name. I have managed to make it work so far as when the last name is...
4
2357
by: Dave | last post by:
I wasn't sure how to search for previous posts about this, it felt real specific. Ok so here's the database & problem: I have 4 combo boxes: cboServer, cboPolicy, cboDB, and cboApplication. The idea behind the database is for a user to search/ select desired information in any kind of combination between the 4 combo boxes. Then the user clicks a button (btnSearch) and subsequently a query ("Search Function") is run that shows all 4...
9
2914
by: prakashwadhwani | last post by:
I have an unbound combo box in the form header. I have used an input mask "CCCC" 40 times to limit the max number of characters to 40. When I tab into the combo box & press a character say "K" for example, the entire first match gets filled in the combo box and the cursor goes to the last character of the combo box. So I can't effectively search for a "KI" until I backspace the entire entry which has got filled in. Once i remove the...
2
1735
by: suckyboy | last post by:
Hi, I have a small problem here. When I search up a search form without a Combo box, the search works fine and display all the results. However, when I setup a search form with a Combo Box, the search does not display anything. Please refer to the link below for my database. https://www.yousendit.com/download/Y...Y3lrWTgwTVE9PQ When I tried using Album Search form which has a combo box to search, no search results comes out. However,...
0
7998
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
8491
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
8470
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
8142
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
6813
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6010
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
5475
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
4022
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1327
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.