A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

How do I set up a value based on another box's value in access?



 
 
Thread Tools Display Modes
  #1  
Old August 9th, 2005, 02:24 PM
idontgetit
external usenet poster
 
Posts: n/a
Default How do I set up a value based on another box's value in access?

I have worked on this problem for over a year and still have not conquered
it. Any help would be very much appreciated.
I have a form that is set up from a table. There are 6 combo boxes. Of the
6 combo boxes 4 of them refer to the same thing. Example: I have one box
for Joe (first name), one box for Smith (last name) another box for his
birthday and the last box for his years employeed. I set up the combo box so
that I have to click on each one individually and each time (4 times) and
click on Joe, Smith, b-day and years employed.
Is there a way to set the other 3 boxes based of the value that I select for
Joe. I have included all the information in every combo box to make sure I'm
pulling the right Joe.
Any ideas?
Thank you VERY MUCH!
  #2  
Old August 9th, 2005, 02:52 PM
Dennis
external usenet poster
 
Posts: n/a
Default

Is there a reason you can't have one combo box with 4 columns instead of 4
separate combo boxes ?

"idontgetit" wrote:

I have worked on this problem for over a year and still have not conquered
it. Any help would be very much appreciated.
I have a form that is set up from a table. There are 6 combo boxes. Of the
6 combo boxes 4 of them refer to the same thing. Example: I have one box
for Joe (first name), one box for Smith (last name) another box for his
birthday and the last box for his years employeed. I set up the combo box so
that I have to click on each one individually and each time (4 times) and
click on Joe, Smith, b-day and years employed.
Is there a way to set the other 3 boxes based of the value that I select for
Joe. I have included all the information in every combo box to make sure I'm
pulling the right Joe.
Any ideas?
Thank you VERY MUCH!

  #3  
Old August 9th, 2005, 03:01 PM
idontgetit
external usenet poster
 
Posts: n/a
Default

I need to show all 4 items in a report, can it be done in one combo box. I
only know how to show one of the values in a combo box?
When I set up the table I set up different fields for sorting reasons.
Thank you!

"Dennis" wrote:

Is there a reason you can't have one combo box with 4 columns instead of 4
separate combo boxes ?

"idontgetit" wrote:

I have worked on this problem for over a year and still have not conquered
it. Any help would be very much appreciated.
I have a form that is set up from a table. There are 6 combo boxes. Of the
6 combo boxes 4 of them refer to the same thing. Example: I have one box
for Joe (first name), one box for Smith (last name) another box for his
birthday and the last box for his years employeed. I set up the combo box so
that I have to click on each one individually and each time (4 times) and
click on Joe, Smith, b-day and years employed.
Is there a way to set the other 3 boxes based of the value that I select for
Joe. I have included all the information in every combo box to make sure I'm
pulling the right Joe.
Any ideas?
Thank you VERY MUCH!

  #4  
Old August 9th, 2005, 03:12 PM
Dennis
external usenet poster
 
Posts: n/a
Default

Yes you can, whatever is selected in the combo box you can get at the other
columns like this

=ComboBox.Column(1)
=ComboBox.Column(2)
etc.

"idontgetit" wrote:

I need to show all 4 items in a report, can it be done in one combo box. I
only know how to show one of the values in a combo box?
When I set up the table I set up different fields for sorting reasons.
Thank you!

"Dennis" wrote:

Is there a reason you can't have one combo box with 4 columns instead of 4
separate combo boxes ?

"idontgetit" wrote:

I have worked on this problem for over a year and still have not conquered
it. Any help would be very much appreciated.
I have a form that is set up from a table. There are 6 combo boxes. Of the
6 combo boxes 4 of them refer to the same thing. Example: I have one box
for Joe (first name), one box for Smith (last name) another box for his
birthday and the last box for his years employeed. I set up the combo box so
that I have to click on each one individually and each time (4 times) and
click on Joe, Smith, b-day and years employed.
Is there a way to set the other 3 boxes based of the value that I select for
Joe. I have included all the information in every combo box to make sure I'm
pulling the right Joe.
Any ideas?
Thank you VERY MUCH!

  #5  
Old August 9th, 2005, 03:27 PM
Sprinks
external usenet poster
 
Posts: n/a
Default

In a relational database, you want to store "attributes" (fields) of "things"
(tables) ONCE. It sounds like you're trying to store the Birthday, LName,
FName, and YearsEmployed in some table other than the Employee table. For
example, an Employee table might have the fields:

EmployeeID AutoNumber (Primary Key)
FName Text
LName Text
Birthday Date/Time
YearsEmployed Integer
Phone Text
Extension Text
WorkGrade Text
Salary Currency
....etc.

If you wish to have an Employee field in ANY OTHER table, all you need to
store is the primary key EmployeeID field. All other fields can be obtained
for a report or for display on a form through a query, or by including them
as columns in a combo box, and using the Column property to display them in
other UNBOUND textboxes.

So what you need is a single combo box Bound to a numeric field, and
textboxes to display other columns that you include in the Row Source of the
combo box.


Combo Box Properties
---------------------------
RowSource SELECT EmployeeID, FName, LName, Birthday, YearsEmployed FROM
YourTable
ORDER BY LName, FName;
Bound Column: 1
Column Count: 5
ColumnWidths: 0";x",y";0",0", where x and y are large enough to display the
widest FName & LName, respectively

To display another column in any unbound textbox, set its ControlSource to:
=YourComboBox.Column(x), where x is the column number, starting from zero
(for example, the third column's index is 2).

Two other comments:

- YearsofService would be better implemented by calculating it from a
HireDate.
- You may wish to combine the FName and LName for display in the combo box.
The EmployeeID will still be stored. The RowSource would then be:

SELECT EmployeeID, LName & ", " & FName AS FullName, Birthday, YearsEmployed
FROM YourTable
ORDER BY FullName;

Hope that helps.
Sprinks



"idontgetit" wrote:

I have worked on this problem for over a year and still have not conquered
it. Any help would be very much appreciated.
I have a form that is set up from a table. There are 6 combo boxes. Of the
6 combo boxes 4 of them refer to the same thing. Example: I have one box
for Joe (first name), one box for Smith (last name) another box for his
birthday and the last box for his years employeed. I set up the combo box so
that I have to click on each one individually and each time (4 times) and
click on Joe, Smith, b-day and years employed.
Is there a way to set the other 3 boxes based of the value that I select for
Joe. I have included all the information in every combo box to make sure I'm
pulling the right Joe.
Any ideas?
Thank you VERY MUCH!

  #6  
Old August 9th, 2005, 04:32 PM
idontgetit
external usenet poster
 
Posts: n/a
Default

Thank you very much for your help!! One questions I have than is when I'm
entering both Bob Smith and Sam Smith in a form to enter b-day's- I only show
Smith and not sure which one b/c I don't have that other field showing.


"Sprinks" wrote:

In a relational database, you want to store "attributes" (fields) of "things"
(tables) ONCE. It sounds like you're trying to store the Birthday, LName,
FName, and YearsEmployed in some table other than the Employee table. For
example, an Employee table might have the fields:

EmployeeID AutoNumber (Primary Key)
FName Text
LName Text
Birthday Date/Time
YearsEmployed Integer
Phone Text
Extension Text
WorkGrade Text
Salary Currency
...etc.

If you wish to have an Employee field in ANY OTHER table, all you need to
store is the primary key EmployeeID field. All other fields can be obtained
for a report or for display on a form through a query, or by including them
as columns in a combo box, and using the Column property to display them in
other UNBOUND textboxes.

So what you need is a single combo box Bound to a numeric field, and
textboxes to display other columns that you include in the Row Source of the
combo box.


Combo Box Properties
---------------------------
RowSource SELECT EmployeeID, FName, LName, Birthday, YearsEmployed FROM
YourTable
ORDER BY LName, FName;
Bound Column: 1
Column Count: 5
ColumnWidths: 0";x",y";0",0", where x and y are large enough to display the
widest FName & LName, respectively

To display another column in any unbound textbox, set its ControlSource to:
=YourComboBox.Column(x), where x is the column number, starting from zero
(for example, the third column's index is 2).

Two other comments:

- YearsofService would be better implemented by calculating it from a
HireDate.
- You may wish to combine the FName and LName for display in the combo box.
The EmployeeID will still be stored. The RowSource would then be:

SELECT EmployeeID, LName & ", " & FName AS FullName, Birthday, YearsEmployed
FROM YourTable
ORDER BY FullName;

Hope that helps.
Sprinks



"idontgetit" wrote:

I have worked on this problem for over a year and still have not conquered
it. Any help would be very much appreciated.
I have a form that is set up from a table. There are 6 combo boxes. Of the
6 combo boxes 4 of them refer to the same thing. Example: I have one box
for Joe (first name), one box for Smith (last name) another box for his
birthday and the last box for his years employeed. I set up the combo box so
that I have to click on each one individually and each time (4 times) and
click on Joe, Smith, b-day and years employed.
Is there a way to set the other 3 boxes based of the value that I select for
Joe. I have included all the information in every combo box to make sure I'm
pulling the right Joe.
Any ideas?
Thank you VERY MUCH!

  #7  
Old August 9th, 2005, 04:41 PM
Sprinks
external usenet poster
 
Posts: n/a
Default

Is the name a combo box or a textbox? If it is a textbox, change the
ControlSource to [LName] & ", " & [FName] to display the full name, or add
another textbox for the other field.

If it is a combo box, change the RowSource as I suggested in my earlier post.

Sprinks

"idontgetit" wrote:

Thank you very much for your help!! One questions I have than is when I'm
entering both Bob Smith and Sam Smith in a form to enter b-day's- I only show
Smith and not sure which one b/c I don't have that other field showing.


"Sprinks" wrote:

In a relational database, you want to store "attributes" (fields) of "things"
(tables) ONCE. It sounds like you're trying to store the Birthday, LName,
FName, and YearsEmployed in some table other than the Employee table. For
example, an Employee table might have the fields:

EmployeeID AutoNumber (Primary Key)
FName Text
LName Text
Birthday Date/Time
YearsEmployed Integer
Phone Text
Extension Text
WorkGrade Text
Salary Currency
...etc.

If you wish to have an Employee field in ANY OTHER table, all you need to
store is the primary key EmployeeID field. All other fields can be obtained
for a report or for display on a form through a query, or by including them
as columns in a combo box, and using the Column property to display them in
other UNBOUND textboxes.

So what you need is a single combo box Bound to a numeric field, and
textboxes to display other columns that you include in the Row Source of the
combo box.


Combo Box Properties
---------------------------
RowSource SELECT EmployeeID, FName, LName, Birthday, YearsEmployed FROM
YourTable
ORDER BY LName, FName;
Bound Column: 1
Column Count: 5
ColumnWidths: 0";x",y";0",0", where x and y are large enough to display the
widest FName & LName, respectively

To display another column in any unbound textbox, set its ControlSource to:
=YourComboBox.Column(x), where x is the column number, starting from zero
(for example, the third column's index is 2).

Two other comments:

- YearsofService would be better implemented by calculating it from a
HireDate.
- You may wish to combine the FName and LName for display in the combo box.
The EmployeeID will still be stored. The RowSource would then be:

SELECT EmployeeID, LName & ", " & FName AS FullName, Birthday, YearsEmployed
FROM YourTable
ORDER BY FullName;

Hope that helps.
Sprinks



"idontgetit" wrote:

I have worked on this problem for over a year and still have not conquered
it. Any help would be very much appreciated.
I have a form that is set up from a table. There are 6 combo boxes. Of the
6 combo boxes 4 of them refer to the same thing. Example: I have one box
for Joe (first name), one box for Smith (last name) another box for his
birthday and the last box for his years employeed. I set up the combo box so
that I have to click on each one individually and each time (4 times) and
click on Joe, Smith, b-day and years employed.
Is there a way to set the other 3 boxes based of the value that I select for
Joe. I have included all the information in every combo box to make sure I'm
pulling the right Joe.
Any ideas?
Thank you VERY MUCH!

  #8  
Old August 9th, 2005, 04:48 PM
idontgetit
external usenet poster
 
Posts: n/a
Default

I'm sorry if I'm hard to understand, thank you for your patience and this is
the last question.

It's a combo box- I understand the bound column, but can i make it show more
than one column? When I bound to the first name (column 2) only the first
name comes up, not Smith AND BOB. ????
Thank you!

"Sprinks" wrote:

Is the name a combo box or a textbox? If it is a textbox, change the
ControlSource to [LName] & ", " & [FName] to display the full name, or add
another textbox for the other field.

If it is a combo box, change the RowSource as I suggested in my earlier post.

Sprinks

"idontgetit" wrote:

Thank you very much for your help!! One questions I have than is when I'm
entering both Bob Smith and Sam Smith in a form to enter b-day's- I only show
Smith and not sure which one b/c I don't have that other field showing.


"Sprinks" wrote:

In a relational database, you want to store "attributes" (fields) of "things"
(tables) ONCE. It sounds like you're trying to store the Birthday, LName,
FName, and YearsEmployed in some table other than the Employee table. For
example, an Employee table might have the fields:

EmployeeID AutoNumber (Primary Key)
FName Text
LName Text
Birthday Date/Time
YearsEmployed Integer
Phone Text
Extension Text
WorkGrade Text
Salary Currency
...etc.

If you wish to have an Employee field in ANY OTHER table, all you need to
store is the primary key EmployeeID field. All other fields can be obtained
for a report or for display on a form through a query, or by including them
as columns in a combo box, and using the Column property to display them in
other UNBOUND textboxes.

So what you need is a single combo box Bound to a numeric field, and
textboxes to display other columns that you include in the Row Source of the
combo box.


Combo Box Properties
---------------------------
RowSource SELECT EmployeeID, FName, LName, Birthday, YearsEmployed FROM
YourTable
ORDER BY LName, FName;
Bound Column: 1
Column Count: 5
ColumnWidths: 0";x",y";0",0", where x and y are large enough to display the
widest FName & LName, respectively

To display another column in any unbound textbox, set its ControlSource to:
=YourComboBox.Column(x), where x is the column number, starting from zero
(for example, the third column's index is 2).

Two other comments:

- YearsofService would be better implemented by calculating it from a
HireDate.
- You may wish to combine the FName and LName for display in the combo box.
The EmployeeID will still be stored. The RowSource would then be:

SELECT EmployeeID, LName & ", " & FName AS FullName, Birthday, YearsEmployed
FROM YourTable
ORDER BY FullName;

Hope that helps.
Sprinks



"idontgetit" wrote:

I have worked on this problem for over a year and still have not conquered
it. Any help would be very much appreciated.
I have a form that is set up from a table. There are 6 combo boxes. Of the
6 combo boxes 4 of them refer to the same thing. Example: I have one box
for Joe (first name), one box for Smith (last name) another box for his
birthday and the last box for his years employeed. I set up the combo box so
that I have to click on each one individually and each time (4 times) and
click on Joe, Smith, b-day and years employed.
Is there a way to set the other 3 boxes based of the value that I select for
Joe. I have included all the information in every combo box to make sure I'm
pulling the right Joe.
Any ideas?
Thank you VERY MUCH!

  #9  
Old August 9th, 2005, 04:54 PM
Sprinks
external usenet poster
 
Posts: n/a
Default

I'm not sure what you're trying to do.

Please post your combo box' RowSource property, and the name of the form's
RecordSource property.

Sprinks

"idontgetit" wrote:

I'm sorry if I'm hard to understand, thank you for your patience and this is
the last question.

It's a combo box- I understand the bound column, but can i make it show more
than one column? When I bound to the first name (column 2) only the first
name comes up, not Smith AND BOB. ????
Thank you!

"Sprinks" wrote:

Is the name a combo box or a textbox? If it is a textbox, change the
ControlSource to [LName] & ", " & [FName] to display the full name, or add
another textbox for the other field.

If it is a combo box, change the RowSource as I suggested in my earlier post.

Sprinks

"idontgetit" wrote:

Thank you very much for your help!! One questions I have than is when I'm
entering both Bob Smith and Sam Smith in a form to enter b-day's- I only show
Smith and not sure which one b/c I don't have that other field showing.


"Sprinks" wrote:

In a relational database, you want to store "attributes" (fields) of "things"
(tables) ONCE. It sounds like you're trying to store the Birthday, LName,
FName, and YearsEmployed in some table other than the Employee table. For
example, an Employee table might have the fields:

EmployeeID AutoNumber (Primary Key)
FName Text
LName Text
Birthday Date/Time
YearsEmployed Integer
Phone Text
Extension Text
WorkGrade Text
Salary Currency
...etc.

If you wish to have an Employee field in ANY OTHER table, all you need to
store is the primary key EmployeeID field. All other fields can be obtained
for a report or for display on a form through a query, or by including them
as columns in a combo box, and using the Column property to display them in
other UNBOUND textboxes.

So what you need is a single combo box Bound to a numeric field, and
textboxes to display other columns that you include in the Row Source of the
combo box.


Combo Box Properties
---------------------------
RowSource SELECT EmployeeID, FName, LName, Birthday, YearsEmployed FROM
YourTable
ORDER BY LName, FName;
Bound Column: 1
Column Count: 5
ColumnWidths: 0";x",y";0",0", where x and y are large enough to display the
widest FName & LName, respectively

To display another column in any unbound textbox, set its ControlSource to:
=YourComboBox.Column(x), where x is the column number, starting from zero
(for example, the third column's index is 2).

Two other comments:

- YearsofService would be better implemented by calculating it from a
HireDate.
- You may wish to combine the FName and LName for display in the combo box.
The EmployeeID will still be stored. The RowSource would then be:

SELECT EmployeeID, LName & ", " & FName AS FullName, Birthday, YearsEmployed
FROM YourTable
ORDER BY FullName;

Hope that helps.
Sprinks



"idontgetit" wrote:

I have worked on this problem for over a year and still have not conquered
it. Any help would be very much appreciated.
I have a form that is set up from a table. There are 6 combo boxes. Of the
6 combo boxes 4 of them refer to the same thing. Example: I have one box
for Joe (first name), one box for Smith (last name) another box for his
birthday and the last box for his years employeed. I set up the combo box so
that I have to click on each one individually and each time (4 times) and
click on Joe, Smith, b-day and years employed.
Is there a way to set the other 3 boxes based of the value that I select for
Joe. I have included all the information in every combo box to make sure I'm
pulling the right Joe.
Any ideas?
Thank you VERY MUCH!

  #10  
Old August 9th, 2005, 06:09 PM
idontgetit
external usenet poster
 
Posts: n/a
Default

I have one table (Tbl_Names and Info) with fname, lname, bday, start date,
etc. that holds all the personal records. I can pull all kinds of reports
from this- b-day for the month, etc.
What I'm trying to do is : pull Bob Smith from (Tbl_Names and Info) and
enter any expenses that we owe them. When I do a combo box I can show the
first and last name (Bob Smith) but b/c these are two different fields, I can
either get the first or last name in as the value. I have to set up another
combo box for Bob and select the another combo box for Smith. Can I set this
up so that when I select Bob- Smith drops into it's own value?
I hope I'm explaining this enough? If not, let me know.
Thank you very much for your time!

"Sprinks" wrote:

I'm not sure what you're trying to do.

Please post your combo box' RowSource property, and the name of the form's
RecordSource property.

Sprinks

"idontgetit" wrote:

I'm sorry if I'm hard to understand, thank you for your patience and this is
the last question.

It's a combo box- I understand the bound column, but can i make it show more
than one column? When I bound to the first name (column 2) only the first
name comes up, not Smith AND BOB. ????
Thank you!

"Sprinks" wrote:

Is the name a combo box or a textbox? If it is a textbox, change the
ControlSource to [LName] & ", " & [FName] to display the full name, or add
another textbox for the other field.

If it is a combo box, change the RowSource as I suggested in my earlier post.

Sprinks

"idontgetit" wrote:

Thank you very much for your help!! One questions I have than is when I'm
entering both Bob Smith and Sam Smith in a form to enter b-day's- I only show
Smith and not sure which one b/c I don't have that other field showing.


"Sprinks" wrote:

In a relational database, you want to store "attributes" (fields) of "things"
(tables) ONCE. It sounds like you're trying to store the Birthday, LName,
FName, and YearsEmployed in some table other than the Employee table. For
example, an Employee table might have the fields:

EmployeeID AutoNumber (Primary Key)
FName Text
LName Text
Birthday Date/Time
YearsEmployed Integer
Phone Text
Extension Text
WorkGrade Text
Salary Currency
...etc.

If you wish to have an Employee field in ANY OTHER table, all you need to
store is the primary key EmployeeID field. All other fields can be obtained
for a report or for display on a form through a query, or by including them
as columns in a combo box, and using the Column property to display them in
other UNBOUND textboxes.

So what you need is a single combo box Bound to a numeric field, and
textboxes to display other columns that you include in the Row Source of the
combo box.


Combo Box Properties
---------------------------
RowSource SELECT EmployeeID, FName, LName, Birthday, YearsEmployed FROM
YourTable
ORDER BY LName, FName;
Bound Column: 1
Column Count: 5
ColumnWidths: 0";x",y";0",0", where x and y are large enough to display the
widest FName & LName, respectively

To display another column in any unbound textbox, set its ControlSource to:
=YourComboBox.Column(x), where x is the column number, starting from zero
(for example, the third column's index is 2).

Two other comments:

- YearsofService would be better implemented by calculating it from a
HireDate.
- You may wish to combine the FName and LName for display in the combo box.
The EmployeeID will still be stored. The RowSource would then be:

SELECT EmployeeID, LName & ", " & FName AS FullName, Birthday, YearsEmployed
FROM YourTable
ORDER BY FullName;

Hope that helps.
Sprinks



"idontgetit" wrote:

I have worked on this problem for over a year and still have not conquered
it. Any help would be very much appreciated.
I have a form that is set up from a table. There are 6 combo boxes. Of the
6 combo boxes 4 of them refer to the same thing. Example: I have one box
for Joe (first name), one box for Smith (last name) another box for his
birthday and the last box for his years employeed. I set up the combo box so
that I have to click on each one individually and each time (4 times) and
click on Joe, Smith, b-day and years employed.
Is there a way to set the other 3 boxes based of the value that I select for
Joe. I have included all the information in every combo box to make sure I'm
pulling the right Joe.
Any ideas?
Thank you VERY MUCH!

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to Do Simple Vector Based Graphics Using MS-Access? Jay Chan General Discussion 2 September 1st, 2004 04:29 PM
From based Database single user to Multiple User??? Richard New to Access New Users 1 August 24th, 2004 02:16 AM
Hiding sheets based on user James General Discussion 3 August 20th, 2004 07:56 PM
Forms: based on query vs. based on table Using Forms 1 August 13th, 2004 02:17 AM
Report Based Upon Parameter Query with Form References Vincent DeLuca Setting Up & Running Reports 4 July 19th, 2004 01:55 AM


All times are GMT +1. The time now is 01:46 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.