473,516 Members | 3,465 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Search a Table with a Form using a Query

4 New Member
Hello

I have a "pocket money new" table (Shown in attachments) contains the money that we gave every week to the people.

I want a form to show me the duplicated CardID (all takings of one person) using queries.

I tried to make criteria in queries to check the text box in the form and search the table for desired CardID and show it in sub form but failed.

what is the right criteria to write.

any help would be greatly appreciated.

thanks

Attached Images
File Type: jpg pocket money new table.jpg (49.2 KB, 298 views)
Sep 24 '15 #1
3 1204
Seth Schrock
2,965 Recognized Expert Specialist
I think that what you are saying is that you want to be able to enter a CardID on the form and then have the query look for all the duplicates for that CardID. If that is the case, then your WHERE clause would be
Expand|Select|Wrap|Line Numbers
  1. WHERE CardID = Forms!YourFormName!YourControlName And DCount("*", "Pocket Money New", "CardID = " & CardID) > 1
Sep 24 '15 #2
hvsummer
215 New Member
@DonMcCoy
you want "a form to show me the duplicated CardID"

I suggest you create a combobox (1st) having row source querytype
Expand|Select|Wrap|Line Numbers
  1. SELECT DISTINCT CARDID from [pocket money new]
then another combox/listbox (2nd) having these code in row source
Expand|Select|Wrap|Line Numbers
  1. SELECT CARDID, Date/time, amount from [pocket money new] WHERE ((CARDID = Forms!formname.CboxcardID))
then set column count of 2nd combobox/listbox to 3, bound column to 1.
design that 2nd comboxbox/listbox width long enough to let you see 3 column.

now, create onclick event for 1st cbox, give it code me.2ndcbox/listboxname.requery

ok, now whenever you choose the IDCARD in 1st cbox, it'll show more detail on 2nd cbox/lbox,
you'll know that IDCARD is dupplicate when detail having more than 2 rows.
Sep 24 '15 #3
NeoPa
32,558 Recognized Expert Moderator MVP
First I would suggest that you need two linked tables (This is part of the very basics of database design Don. Have a trawl through Database Normalisation and Table Structures for some more on that).

One table would contain data related to whatever element is represented by the [CardID] field. The other by pocket money payments that reference a cardID.

Next you would define a relationship between the two tables on the [CardID] field that is common to both. From there set up a form to manage the main (CardID) table. Onto that form add a subform for the other table and let the wizard do the rest for you. You may well be interested in examining what the wizard produces for you so that you can learn and move forward, but it should handle all you need without further interference from you.

It's perfectly possible to use Cascaded Form Filtering, but why make life complicated when a better solution is provided with no effort using an Access wizard.
Sep 24 '15 #4

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

Similar topics

1
5841
by: Aftershock | last post by:
I have looked on the groups but can't seem to find an answer. I have a parameter query that uses a form for its input. This form then opens up a search result form based on the query. It is from this form that I want to print via a report all of the returned records shown on the form. I can print off a single current record shown in the...
2
2698
by: Apple | last post by:
I had create a query with one table and one query, and then create form with that query using wizard, but I can't append or edit data in that form & query. Please help!
2
1410
by: Jono | last post by:
Simple application - 2 tables, 1 qry and 1 form only. The main table is tblProjects and describes each of about 100 business projects. Each and every Project is developed under a particular business Goal/Strategy combination. I store Goal/Strategy codes in each record of tbl Projects. The other table, tblGoalsAndStrategies, is simply a...
3
1693
by: Artur | last post by:
I need access table as a result of cross query? What should I do? Artur
2
1744
by: SMBR via AccessMonster.com | last post by:
I am not completely new to Access, but I have run into a road block in trying to normalize my database. I am not sure if I am using the correct structure here. I have tried to post a few times without any luck or suggestions. If you can help, I would appreciate it. I have 2 tables. T_Job Info is: Date Entered Job Number (autonumber)
3
4565
by: Jahangir | last post by:
Dear Fellows, I m in in Access VB, and working on a small project. Problem is that In main form (called search )I have made a textbox name text34, and a search button, which responsiblity is to open a form. I have made a query that show results which 'like Form.search.text34.text'. when i execut this query by double clicking its ask me to...
5
2032
by: SeanCly10 | last post by:
Hi all. I don't want to sound like a complete idiot here, but I'm somewhat limited in my coding knowledge, and I need some advice and help. I'm working on a database that will eventually be used to hold patient information for research purposes. What I'm trying to do is create a form-based query system that will be easier (and less...
3
1857
manoj9849967222
by: manoj9849967222 | last post by:
HI All I have two tables One is "master" & the other one is "child". The master Table have filds Productcode -----Number Productname-------Text Child Table
8
3344
by: hollinshead | last post by:
Hi there i have bit of an issue. i haver this database that is purely used for searching records under certain criteria. This criteria is chosen by the user on a form using list boxes and combo boxes. So when the criteria is chosen the user selects a click command button and then the results are displayed on another form. I have successfully...
3
1656
by: emma pierreux | last post by:
Hello I am from Belgium . I am trying to adjust a table to work with it in access. The table called grootboekrekeningopbrengsten and results from an excel file I imported in access (see the attached file) unfortunately I cannot use it until I make some rearrangements.The fields of the tabele are Periode Datum Dagboek Docnr Bedrijf /...
0
7273
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7405
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. ...
0
7574
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...
1
7136
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...
0
7547
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...
0
5712
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...
1
5106
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...
0
3252
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1620
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

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.