By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
464,760 Members | 1,123 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 464,760 IT Pros & Developers. It's quick & easy.

Subforms & Counting

P: n/a
Hi all,
I have 2 tables in a one to many relationship.
The first table is customer's info.
Second table is customer's assets.
I have an autonumber field in the customer's table
which I use for a customer ID number, and it's the
primary key. The Child key in the assets table
is a number field.

The first table (customers), is used on a main form with
the data from the second table (assets), as a subform.

Now, I also need an "autonumber" field in the assets
table that counts the assets for each particular customer
as I enter them into the assets table via the subform.
If I simply insert an autonumber field into the assets table,
I get an ongoing count for all assets of all customers.

Thanks for any help,

Mark


Nov 12 '05 #1
Share this Question
Share on Google+
4 Replies

P: n/a
see: DCount(Expr, Domain, Criteria)

John Bickmore
www.BicycleCam.com
www.Feed-Zone.com

"MARK TURNER" <tu********@verizon.net> wrote in message
news:y_******************@nwrddc02.gnilink.net...
Hi all,
I have 2 tables in a one to many relationship.
The first table is customer's info.
Second table is customer's assets.
I have an autonumber field in the customer's table
which I use for a customer ID number, and it's the
primary key. The Child key in the assets table
is a number field.

The first table (customers), is used on a main form with
the data from the second table (assets), as a subform.

Now, I also need an "autonumber" field in the assets
table that counts the assets for each particular customer
as I enter them into the assets table via the subform.
If I simply insert an autonumber field into the assets table,
I get an ongoing count for all assets of all customers.

Thanks for any help,

Mark

Nov 12 '05 #2

P: n/a
Hi,
I worked with the DCount function. I don't think it's going to provide me
with what I was looking for. More than likely a lack of skills on this end.
I'm looking for something similar to an autonumber field, except it will
pertain only to the current subdataset. Example: I have a client,
(on a main form), and as I enter data into that client's subform, I would
like to have the item number automatically incremented by a count of one
for each new entry. After I'm done adding elements to the clients subform,
I will
add another client on the main form. I'd like the number field in the
subform to start counting
at 1 again for the new client.
Right now I'm using a regular number field and have to type in the
item number as I go.
Thanks for the information though.

Mark
Nov 12 '05 #3

P: n/a
Have a look here:
http://www.lebans.com/rownumber.htm
Rownumber.zip is a database containing functions for the automatic row
numbering of Forms, SubForms and Queries.

Updated Oct. 13 by Allen Browne. Includes error handling and cleaned
code.
--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
"Mark T." <tu********@verizon.net> wrote in message
news:wC*****************@nwrddc03.gnilink.net...
Hi,
I worked with the DCount function. I don't think it's going to provide me with what I was looking for. More than likely a lack of skills on this end. I'm looking for something similar to an autonumber field, except it will pertain only to the current subdataset. Example: I have a client,
(on a main form), and as I enter data into that client's subform, I would like to have the item number automatically incremented by a count of one for each new entry. After I'm done adding elements to the clients subform, I will
add another client on the main form. I'd like the number field in the
subform to start counting
at 1 again for the new client.
Right now I'm using a regular number field and have to type in the
item number as I go.
Thanks for the information though.

Mark


Nov 12 '05 #4

P: n/a
Thanks Stephen,

I took the module apart. I think I can make it work.

Mark
Nov 12 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.