473,406 Members | 2,217 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Automatically fill fields.

JA
Not exactly sure how to explain this. I have 4 fields (in access 2000).

Category, Catid, Subcat, subcatid.
There are 40 categories, and about 1500 subcats. I've added the categories
to the lookup, so when I enter them in the field, I can usually just type
the first letter or two. (they are in a dropdown box).

I would like to have the CatID show up automatically in it's field, after I
type in the category.

And then, have the Subcats show in a dropdown box, but only the ones that go
to the category in the first field.

AND, after I pick the subcat, have it's ID number show up in the 4th field.

So if I picked Balls, categoryID 2 would show up in the next field, and then
a dropdown with Baseball,Basketball,Football would show in the 3rd field,
and when I picked Basketball, 132 would show up in the 4th field.

Hope that makes sense. Is that possible? How would I go about it?

Thanks! J~
May 1 '07 #1
4 2320
Do you need the catid and subcatid to show?

If you do you should eliminate then from your table and just have category
and subcat. The you could do a look up on your form to reference the ids
from yout category and sub category tables.
"JA" <jarmour at kc.rr.comwrote in message
news:46**********************@roadrunner.com...
Not exactly sure how to explain this. I have 4 fields (in access 2000).

Category, Catid, Subcat, subcatid.
There are 40 categories, and about 1500 subcats. I've added the categories
to the lookup, so when I enter them in the field, I can usually just type
the first letter or two. (they are in a dropdown box).

I would like to have the CatID show up automatically in it's field, after
I type in the category.

And then, have the Subcats show in a dropdown box, but only the ones that
go to the category in the first field.

AND, after I pick the subcat, have it's ID number show up in the 4th
field.

So if I picked Balls, categoryID 2 would show up in the next field, and
then a dropdown with Baseball,Basketball,Football would show in the 3rd
field, and when I picked Basketball, 132 would show up in the 4th field.

Hope that makes sense. Is that possible? How would I go about it?

Thanks! J~

May 1 '07 #2
JA


Scott, I do need them to show. I have the categories in, looking up a
value list, with them in like so:

balls;bats;cats;dogs

The next field, I had it lookup a query. It gives me a dropdown of the
catids, but they aren't connected to the categories.

What I want to happen, is if I choose balls in the category field, a "1"
will show up in the catid field, and if I choose bats, a "2" will show
up, and so on.

But I don't really know what I'm doing. So any help is appreciated!
*** Sent via Developersdex http://www.developersdex.com ***
May 1 '07 #3
There may be other way to do it, but this is how I would do it.

******REMEMBER that this is an example...you will need to change some
field names and table names to make it work with your
enviroment.************
First Create your two tables with the appropriate fields:

-Categories (TABLE)
--CatID (FIELD)
--CategoryName (FIELD)

-SubCategories (TABLE)
--SubCatID (FIELD)
--SubCategoryName (FIELD)
--CatID (FIELD)

Categoiries.CatID Needs to have a relationship with
SubCategories.CatID
As you fill in the subCategories a CatID needs to be populated as
well.
Now for the FORM and 4 "Unbound" Fields:

-Cat_SubCat FORM
--Cat 'Should be a Combo Box
--CatID 'Should be a Text Box
--SubCat 'Should be a Combo Box
--SubCatID 'Should be a Text Box
Now for the field properites:

--Cat (Combo Box)

Under Properties/Data tab:
RowSource Type: Table/Query (default)
Row Source: SELECT Category.CatID, Category.Category FROM Category;

Under Properties/Event Tab:
After Update: [Event Procedure] Click on the [...] button at the
end of the row:

Private Sub Cat_AfterUpdate()

Me.CatID = Me.Cat.Column(0)
Me.SubCat.Requery
Me.SubCatID = Null
End Sub
--SubCat (Combo Box)

Under Properties/Data tab:
RowSource Type: Table/Query (default)
Row Source: SELECT SubCategory.SubCatID,
SubCategory.SubCategory,SubCategory.CatID FROM SubCategory WHERE
(((SubCategory.CatID)=Forms!Cat_SubCat!CatID));

Under Properties/Event Tab:
After Update: [Event Procedure] Click on the [...] button at the
end of the row:

Private Sub CatSub_AfterUpdate()

Me.SubCatID = Me.SubCat.Column(0)

End Sub
That should get you what you want. Study it and learn how everything
links and works to nake it a learning experience. I hope it helps!

On Apr 30, 7:31 pm, JA <jarmour at kc.rr.comwrote:
Scott, I do need them to show. I have the categories in, looking up a
value list, with them in like so:

balls;bats;cats;dogs

The next field, I had it lookup a query. It gives me a dropdown of the
catids, but they aren't connected to the categories.

What I want to happen, is if I choose balls in the category field, a "1"
will show up in the catid field, and if I choose bats, a "2" will show
up, and so on.

But I don't really know what I'm doing. So any help is appreciated!

*** Sent via Developersdexhttp://www.developersdex.com***

May 2 '07 #4
JA
Thanks Anonymous, but this seems to be for a form. I want it to be in
the table itself. Is that possible?

*** Sent via Developersdex http://www.developersdex.com ***
May 5 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: paul b | last post by:
Hello, I have a small problem in PHP an perhaps someone can help me: I have a simple HTML login page with a username and a password field, as well as a submit button, which I have to use for...
8
by: netsurfer | last post by:
Hi: Have a question on making the date automatically filled in by what the user enters in by the date at the top. The date entered at the top would most likely be on a Wednesday then I need...
1
by: Charles Robinson III | last post by:
When selecting a option from a drop down menu in the form view, which is linked to a table with three columns, how do I get Access to automatically fill in two other fields automatically once the...
0
by: Aravind | last post by:
Hi folks. I have the following tables (PK = primary key, FK = foreign key): Member (MemNo , MemName, MemType, Course/Faculty) History (..., MemNo , ...) Member and History are linked in a 1...
7
by: jballard | last post by:
Hello, I have a database set-up with a form and two subforms in it. I have one of the subforms (replacement parts) set-up where you can pick part numbers from a drop down box and also pick a...
2
by: DP | last post by:
hi, i have created a video rental database system. i have created a customer form, and a film form. i related all the tables, with; tblCustomer has membershipID, which is primary and...
1
by: moorebj | last post by:
I am having trouble writing a SELECT query. I have a "Customer" table with "Customer Name", "Street Address" and "Suburb, State, Post Code" fields. On a form I would like to be able to enter in...
1
by: cclayton000 | last post by:
Does anyone have a basic example of a script that can automatically fill fields in a subform? Here is the scenario: I have a main form for a Sample Lot and I have added some side-fields (not...
1
by: pctec | last post by:
Hello, I have a combo box that is looking into a field from a table named Machines, this machine table has two columns; MachineName and MachineRate but the Combo Box it only showing the MachineName...
0
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
0
BarryA
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...
1
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...
0
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...
0
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,...
0
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,...
0
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...
0
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,...
0
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...

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.