473,624 Members | 2,575 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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,Basket ball,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 2339
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,Basket ball,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.Cat ID Needs to have a relationship with
SubCategories.C atID
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.Catego ry 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.Reque ry
Me.SubCatID = Null
End Sub
--SubCat (Combo Box)

Under Properties/Data tab:
RowSource Type: Table/Query (default)
Row Source: SELECT SubCategory.Sub CatID,
SubCategory.Sub Category,SubCat egory.CatID FROM SubCategory WHERE
(((SubCategory. CatID)=Forms!Ca t_SubCat!CatID) );

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

Private Sub CatSub_AfterUpd ate()

Me.SubCatID = Me.SubCat.Colum n(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 Developersdexht tp://www.developersd ex.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
3814
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 login(I cannot simply replace it by a php-page :-(). is it possible to call this page via a hyperlink from a php-script and to directly fill the username and password fields as well to raise the event of clicking the submit button.
8
2228
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 to have all the prior dates pop in. Example: User enters 2/9/05 in the date field at the top being a Wednesday...I need the dates at the bottom to be filled in automatically, respectively as 2/3/05, 2/4/05, 2/5/05, 2/6/05, 2/7/05, 2/8/05, 2/9/05...
1
3053
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 first field is selected, and by using the remaining two columns?
0
1317
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 (Member) to Many (History) relationship. I have a form (frmHistory) based on a query (qryHistory) which is based on these tables.
7
2231
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 description of the part from a drop down box. These are two separate fields. I want to be able to pick the part number and have it put in the description automatically or the other way around. Which ever would by easier?
2
1910
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 autonumber, tblFilm has FilmID, which is primary and autonumber, tblFilmRental , which has RentalID, CsutomerID, and FilmID
1
408
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 the "Customer Name" and automatically fill in the "Street Address" and "Suburb, State, Post Code" fields from this table. All of the fields on the form are COMBO boxes. Any help would be greatly appreciated.
1
2448
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 bound to any table) that asks basic information: Number of Samples (x), Quantity, Unit of Measure, Location, Tray...I would then like a button that triggers a script to automatically create the Sample Details (subform) that is autonumbered and then...
1
2199
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 field. What I want is to fill a different table with the MachineRate as soon as I select the MachineName. I’m already storing the MachineName with the Combo Box to table1 but need to extract automatically the MachineRate into a table1 as I select...
0
8249
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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8685
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8348
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 most users, this new feature is actually very convenient. If you want to control the update process,...
0
7176
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 launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6112
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5570
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
2613
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
1
1797
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1493
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.