How do you create a field on a form that counts the selected records, only if a certain word is in the field.
Records are selected via a combo box on a form header.
I then have tabs below that display different subforms.(One of the tabs is orders)
Basically i have combo box on the orders form that lists all posible locations for a particular item e.g.
"location 1 - sub location 1"
"location 1 - sub location 2"
"location 2 - sub location 1"
"location 2 - sub location 2"
i want to count all the records that have "location 1" at the start and display the quantity in a field on the orders form
5 4798
How do you create a field on a form that counts the selected records, only if a certain word is in the field.
Records are selected via a combo box on a form header.
I then have tabs below that display different subforms.(One of the tabs is orders)
Basically i have combo box on the orders form that lists all posible locations for a particular item e.g.
"location 1 - sub location 1"
"location 1 - sub location 2"
"location 2 - sub location 1"
"location 2 - sub location 2"
i want to count all the records that have "location 1" at the start and display the quantity in a field on the orders form
This would be the general idea: -
Me![txtQuantity] = DCount("*", "<Your Table Name>", "Left([<Location Field>], 10) = 'Location 1'")
This would be the general idea: -
Me![txtQuantity] = DCount("*", "<Your Table Name>", "Left([<Location Field>], 10) = 'Location 1'")
Cheers for the quick response ADezii.
I've been trying to get that code to work but unfortunatly i'm not very good when it comes to visual basic and i haven't been successful yet.
Can you give me step by step instructions, or is their another way of doing it e.g. expression builder or a query
P.S. forgive me if i sound stupid, but i am!
Cheers for the quick response ADezii.
I've been trying to get that code to work but unfortunatly i'm not very good when it comes to visual basic and i haven't been successful yet.
Can you give me step by step instructions, or is their another way of doing it e.g. expression builder or a query
P.S. forgive me if i sound stupid, but i am!
I'll need your Table Name, Location Field Name in the Table, and the Location Field Name on the Form, and the Quantity Field Name.
I'll need your Table Name, Location Field Name in the Table, and the Location Field Name on the Form, and the Quantity Field Name.
Table name is "Scaling", field name in the table is "Location Name", field name on the form is "Location Name" and the quantity field name is "Quantity"
Cheers for the help ADezii
Table name is "Scaling", field name in the table is "Location Name", field name on the form is "Location Name" and the quantity field name is "Quantity"
Cheers for the help ADezii
Try: -
Me![Quantity] = DCount("*", "Scaling", "Left([Location Name], 10) = '" & Me![Location Name] & "'")
Sign in to post your reply or Sign up for a free account.
Similar topics
by: thomasp |
last post by:
I am trying to get a record count of a PHP query on a MS Acess database
using ODBC with a DSN for MS ACCESS connection. I got this code from the
PHP manual user notes. It seems to return the...
|
by: Cro |
last post by:
Hello Access Developers,
I'd like to know if it is possible to perform a count in an expression
that defines a control source.
My report is based on a query. In my report, I want a text box to...
|
by: Invalidlastname |
last post by:
Hi,
We are developing an asp.net application, and we dynamically created certain literal controls to represent some read-only text for certain editable controls. However, recently we found an issue...
|
by: Volkan |
last post by:
Hi,
I'm trying to compare two XML documents and i'm using XPath queries to
select nodes. XPathNavigator's Select method runs fast enough and
returns an XPathNodeIterator object. When i try to...
|
by: heckstein |
last post by:
I am working in Access 2002 and trying to create a report from our company's learming management system. I am not a DBA and most of my SQL knowledge has been self taught through trial and error. I...
|
by: MP |
last post by:
vb6,ado,mdb,win2k
i pass the sql string to the .Execute method on the open connection to
Table_Name(const) db table
fwiw
(the connection opened via class wrapper:)
msConnString = "Data Source="...
|
by: Phil Stanton |
last post by:
I am trying to count the fields in a queryDef in an external database.
If I run this in the actaal database I get Fields.count = 6 correctly
Private Sub ObjectName_DblClick(Cancel As Integer)
...
|
by: CampbellJD1 |
last post by:
I am using Access 2003 Professional. I have been working with Access for some time and I have created an MDB with a Linked Table and the Data there is temporarily transferred to other Table for...
|
by: wildThought |
last post by:
If I have an object that contains a generic dictionary inside of it,
how do I get access to its properties such as count?
|
by: craigchalmers |
last post by:
Hi
I am a complete novice so hope someone can shed some light on my
problem/goal.
I have an access database with some records in it. i have two fields
1) ArrivalDate 2) ReturnDate
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
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...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
|
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,...
|
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...
|
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,...
|
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...
| |