Hi,
Can some please provide me with the code for counting records in a subform and displaying it in a textbox?
Does this code go into the control source of the textbox?
My subform is called 'Asset subform' within the form 'Form1'.. the textbox will be in the same form.
Also im showing records in a subform by selecting a user from a combobox...
How can i input a users name in a textbox once i have selected him from the combobox?
All help will be appreciated
11 9459
Hi,
Can some please provide me with the code for counting records in a subform and displaying it in a textbox?
Does this code go into the control source of the textbox?
My subform is called 'Asset subform' within the form 'Form1'.. the textbox will be in the same form.
Also im showing records in a subform by selecting a user from a combobox...
How can i input a users name in a textbox once i have selected him from the combobox?
All help will be appreciated
In the Control Source of the Text Box on Form1, place the following code: - =DCount("*","<Record Source for Sub-Form>","[<Linking Field>]=" & Forms!Form1![<Primary Key>])
In the Control Source of the Text Box on Form1, place the following code: - =DCount("*","<Record Source for Sub-Form>","[<Linking Field>]=" & Forms!Form1![<Primary Key>])
for some reason im getting an error : Error?
ive inserted the following code:
=DCount("*","<Asset subform>","[<Text16>]=" & Forms!Form1![<ID>])
Am i doing something obviously wrong?
My subform is called: Asset subform
My Form is called: Form1
TextBox is called: Text16
and the primary key for my main table is 'ID'...
im confused???
First off, drop the < and > ! When used in example code, whether here or in text books, <Things Like This> takes the place of an object name, so if your Primary Key is named ID, [<Primary Key>]
would become [ID]
when you actually write your code.
Linq ;0)>
Hi,
thanks for reply,
ive tried that, got rid of the <>
but im still getting an error??
Hi,
thanks for reply,
ive tried that, got rid of the <>
but im still getting an error??
Replace Asset subform with the Name of the Record Source for the Sub-Form via Select Asset subform ==> Properties ==> Data Tab ==> Record Source.
Thank you for the replies..
the record source for my subform is: - SELECT Asset.ID, Asset.Asset, Asset.[Product Type], Asset.Manufacturer, Asset.Description, Asset.[Model No], Asset.[Serial No], Asset.[Windows Key], Asset.User, Asset.Department, Asset.Location, Asset.[Comms Date], Asset.Returned, Asset.[Return Reason] FROM Asset WHERE (((Asset.User) Like Forms!AssetMain!Combo2));
so ive got the following: - =DCount("*","SELECT Asset.ID, Asset.Asset, Asset.[Product Type], Asset.Manufacturer, Asset.Description, Asset.[Model No], Asset.[Serial No], Asset.[Windows Key], Asset.User, Asset.Department, Asset.Location, Asset.[Comms Date], Asset.Returned, Asset.[Return Reason] FROM Asset WHERE (((Asset.User) Like Forms!AssetMain!Combo2))","[Text16]=" & [Forms]![Form1]![ID])
But im still seeing an error?? y?
thanks
Thank you for the replies..
the record source for my subform is: - SELECT Asset.ID, Asset.Asset, Asset.[Product Type], Asset.Manufacturer, Asset.Description, Asset.[Model No], Asset.[Serial No], Asset.[Windows Key], Asset.User, Asset.Department, Asset.Location, Asset.[Comms Date], Asset.Returned, Asset.[Return Reason] FROM Asset WHERE (((Asset.User) Like Forms!AssetMain!Combo2));
so ive got the following: - =DCount("*","SELECT Asset.ID, Asset.Asset, Asset.[Product Type], Asset.Manufacturer, Asset.Description, Asset.[Model No], Asset.[Serial No], Asset.[Windows Key], Asset.User, Asset.Department, Asset.Location, Asset.[Comms Date], Asset.Returned, Asset.[Return Reason] FROM Asset WHERE (((Asset.User) Like Forms!AssetMain!Combo2))","[Text16]=" & [Forms]![Form1]![ID])
But im still seeing an error?? y?
thanks
You must use a Table name or Query for the 2nd Argument for the DCount() Function as in: - DCount("*", "<Table Name>")
-
DCount("*", "<Query Name>")
You must use a Table name or Query for the 2nd Argument for the DCount() Function as in: - DCount("*", "<Table Name>")
-
DCount("*", "<Query Name>")
honestly im confused now, why two Dcounts?
thanks
excellent,
thank you for your patience...
it counts the records now.... it counts the users in the table 'Asset'.
Im selecting a user from a combobox, and then displaying the records for this user in the subform. how can i get it to count records in the subform?
anyone?
any help will be appreciated..
thanks
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Rey |
last post by:
Howdy all.
Appreciate your help with several problems I'm having:
I'm trying to determine if the Visit subform (subformVisits) has a new
record or been changed, i.e. dirty. The form that...
|
by: PeteCresswell |
last post by:
I'm looking for some code that makes a list presented in a subform
autoscroll in response to the user typing - like a combo box dropdown
or a regular ListBox does.
I.e. The user is looking at...
|
by: Carl |
last post by:
I have a main form with navigation buttons on it and a label showing
for example Record 1 of 15 using recordsetclone on it and eveything
works fine. When I move through the records the record...
|
by: CSDunn |
last post by:
Hello,
In an Access 2003 ADP Subform, I am trying to set the BackGround color
of three textbox fields (LSScore, RScore, WScore) in the current
record of the subform to zero (black) if the value of...
|
by: Simon P |
last post by:
Hello group, I'm in desperate need of help. Here goes :
I have the following tables : CONTACTS (ContactID, FirstName,
LastName, Company, etc.), SHOWS (ShowID, ShowDescription) and
SHOWDETAILS...
|
by: Joshua Ammann |
last post by:
Hi,
(Using Access 2000)
I have two tables, similar to Customers and Orders. (Not an exact
parallel, but works for this example.)
On a form showing customer data, there is a tab control. One...
|
by: Lyn |
last post by:
Hi,
I have a form which contains a number of subforms in different pages of a
tab control. In the detail section of each subform, I list records related
to the main form record, but from...
|
by: matthewemiclea |
last post by:
So I think this may be a stretch, but I have a subform that is
displayed on a main form. The subform is based on a query that brings
records from a table(It does not bring all fields, but the main...
|
by: bitsnbytes64 |
last post by:
Hi,
I have a form which contains a subform. Both are were creetd using the form wizard and are bound by the column IXO_NR (on two different tables), which is the control source for a textbox on...
|
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: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
|
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: 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: 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...
|
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...
|
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...
| |