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 » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Set Field Value Based on Entry in another field



 
 
Thread Tools Display Modes
  #1  
Old March 1st, 2010, 05:53 PM posted to microsoft.public.access
mike
external usenet poster
 
Posts: 3,942
Default Set Field Value Based on Entry in another field

Access 2003 and total noob here. Sorry - I can't seem to find anything that
answers my question through searches here...maybe I'm too new so I don't
recognize the solution when I see it.

I have a form where users select their organization name from a menu. The
menu is populated from a query against the organization table.

The organization table has three columns (ID (pk), ORGNAME, ORGID). The
ORGID is a two character acronym for the organization.

I need to populate a hidden field on the form with the ORGID based on the
selection made in the Org Name menu. How do I do that? I need that ORGID
because it's being used in a calculation based on a change event.

For example:

ORG TABLE
ID ORGNAME ORGID
1 Fred's Bait and Tackle FB
2 Avery's Aviary AA
3 Zelda's Crochet Shop ZC

The user chooses "Fred's Bait and Tackle" in the Org Name menu, the Org ID
field should show "FB". If "Zelda's Crochet Shop" then Org ID should be "ZC",
etc.

Does that provide enough info to explain what I'm trying to do? With
InfoPath, I could do it pretty easily - but my new users don't have InfoPath,
so I'm building this in Access and will be splitting the DB.

Thanks in advance for any help, advice, pointers y'all might have!

Mike
  #2  
Old March 1st, 2010, 06:08 PM posted to microsoft.public.access
Duane Hookom
external usenet poster
 
Posts: 7,177
Default Set Field Value Based on Entry in another field

In Access, these controls are Combo Boxes, not Menus.

If you want a non-visible column to display in another text box on the form,
you can usually set the control source of the text box to:
=cboOrgName.Column(x)
x is the column number with 0 being the first column.

If you think you actually need to store this information rather than just
display, you can add code to the After Update event of the combo box like:
Me.txtMyTextBox = cboOrgName.Column(x)

--
Duane Hookom
Microsoft Access MVP


"Mike" wrote:

Access 2003 and total noob here. Sorry - I can't seem to find anything that
answers my question through searches here...maybe I'm too new so I don't
recognize the solution when I see it.

I have a form where users select their organization name from a menu. The
menu is populated from a query against the organization table.

The organization table has three columns (ID (pk), ORGNAME, ORGID). The
ORGID is a two character acronym for the organization.

I need to populate a hidden field on the form with the ORGID based on the
selection made in the Org Name menu. How do I do that? I need that ORGID
because it's being used in a calculation based on a change event.

For example:

ORG TABLE
ID ORGNAME ORGID
1 Fred's Bait and Tackle FB
2 Avery's Aviary AA
3 Zelda's Crochet Shop ZC

The user chooses "Fred's Bait and Tackle" in the Org Name menu, the Org ID
field should show "FB". If "Zelda's Crochet Shop" then Org ID should be "ZC",
etc.

Does that provide enough info to explain what I'm trying to do? With
InfoPath, I could do it pretty easily - but my new users don't have InfoPath,
so I'm building this in Access and will be splitting the DB.

Thanks in advance for any help, advice, pointers y'all might have!

Mike

  #3  
Old March 1st, 2010, 06:38 PM posted to microsoft.public.access
Steve[_77_]
external usenet poster
 
Posts: 1,017
Default Set Field Value Based on Entry in another field

Your use of ORGID in a calculation based on a change event is very odd. If
you want, excplain what you are doing and maybe we can help you do it in a
better way.

Steve




"Mike" wrote in message
...
Access 2003 and total noob here. Sorry - I can't seem to find anything
that
answers my question through searches here...maybe I'm too new so I don't
recognize the solution when I see it.

I have a form where users select their organization name from a menu. The
menu is populated from a query against the organization table.

The organization table has three columns (ID (pk), ORGNAME, ORGID). The
ORGID is a two character acronym for the organization.

I need to populate a hidden field on the form with the ORGID based on the
selection made in the Org Name menu. How do I do that? I need that ORGID
because it's being used in a calculation based on a change event.

For example:

ORG TABLE
ID ORGNAME ORGID
1 Fred's Bait and Tackle FB
2 Avery's Aviary AA
3 Zelda's Crochet Shop ZC

The user chooses "Fred's Bait and Tackle" in the Org Name menu, the Org ID
field should show "FB". If "Zelda's Crochet Shop" then Org ID should be
"ZC",
etc.

Does that provide enough info to explain what I'm trying to do? With
InfoPath, I could do it pretty easily - but my new users don't have
InfoPath,
so I'm building this in Access and will be splitting the DB.

Thanks in advance for any help, advice, pointers y'all might have!

Mike



  #4  
Old March 1st, 2010, 07:05 PM posted to microsoft.public.access
Loterken
external usenet poster
 
Posts: 12
Default Set Field Value Based on Entry in another field

i may be totally wrong here, but should the primary key not be ORGID?
can 2 different organizations have the same ORGID ?


  #5  
Old March 1st, 2010, 07:48 PM posted to microsoft.public.access
John... Visio MVP
external usenet poster
 
Posts: 900
Default Set Field Value Based on Entry in another field

"Steve" wrote in message
...
Your use of ORGID in a calculation based on a change event is very odd. If
you want, excplain what you are doing and maybe we can help you do it in a
better way.

Steve



Excplain? How can you help when you can not even spell?

John... Visio MVP

  #6  
Old March 1st, 2010, 09:24 PM posted to microsoft.public.access
Stop$teve
external usenet poster
 
Posts: 76
Default Set Field Value Based on Entry in another field


"Steve" schreef in bericht ...
Your use of ORGID in a calculation based on a change event is very odd. If you want, excplain what you are doing and maybe we can
help you do it in a better way.


You are NOT one of us $teve... get lost !!

Arno R


  #7  
Old March 1st, 2010, 09:40 PM posted to microsoft.public.access
John W. Vinson
external usenet poster
 
Posts: 18,261
Default Set Field Value Based on Entry in another field

On Mon, 1 Mar 2010 09:53:02 -0800, Mike
wrote:

I need to populate a hidden field on the form with the ORGID based on the
selection made in the Org Name menu. How do I do that? I need that ORGID
because it's being used in a calculation based on a change event.

For example:

ORG TABLE
ID ORGNAME ORGID
1 Fred's Bait and Tackle FB
2 Avery's Aviary AA
3 Zelda's Crochet Shop ZC


Why the extra step? Cannot your calculation simply be based on the selected
value in the combo box? As Loterken suggests, you could make ORGID the Primary
Key and the bound column of your combo box (Microsoft tries to imply that
every table must have an autonumber as a primary key, but that is not the
case; the PK must be unique and should be stable and short, and your ORGID
qualifies).
--

John W. Vinson [MVP]
  #8  
Old March 13th, 2010, 05:57 PM posted to microsoft.public.access
De Jager
external usenet poster
 
Posts: 393
Default Set Field Value Based on Entry in another field


"Mike" wrote in message
...
Access 2003 and total noob here. Sorry - I can't seem to find anything
that
answers my question through searches here...maybe I'm too new so I don't
recognize the solution when I see it.

I have a form where users select their organization name from a menu. The
menu is populated from a query against the organization table.

The organization table has three columns (ID (pk), ORGNAME, ORGID). The
ORGID is a two character acronym for the organization.

I need to populate a hidden field on the form with the ORGID based on the
selection made in the Org Name menu. How do I do that? I need that ORGID
because it's being used in a calculation based on a change event.

For example:

ORG TABLE
ID ORGNAME ORGID
1 Fred's Bait and Tackle FB
2 Avery's Aviary AA
3 Zelda's Crochet Shop ZC

The user chooses "Fred's Bait and Tackle" in the Org Name menu, the Org ID
field should show "FB". If "Zelda's Crochet Shop" then Org ID should be
"ZC",
etc.

Does that provide enough info to explain what I'm trying to do? With
InfoPath, I could do it pretty easily - but my new users don't have
InfoPath,
so I'm building this in Access and will be splitting the DB.

Thanks in advance for any help, advice, pointers y'all might have!

Mike


  #9  
Old March 17th, 2010, 01:49 PM posted to microsoft.public.access
joelgeraldine
external usenet poster
 
Posts: 201
Default Set Field Value Based on Entry in another field

kjjkjkj

"Mike" a écrit dans le message de groupe de
discussion : ...
Access 2003 and total noob here. Sorry - I can't seem to find anything
that
answers my question through searches here...maybe I'm too new so I don't
recognize the solution when I see it.

I have a form where users select their organization name from a menu. The
menu is populated from a query against the organization table.

The organization table has three columns (ID (pk), ORGNAME, ORGID). The
ORGID is a two character acronym for the organization.

I need to populate a hidden field on the form with the ORGID based on the
selection made in the Org Name menu. How do I do that? I need that ORGID
because it's being used in a calculation based on a change event.

For example:

ORG TABLE
ID ORGNAME ORGID
1 Fred's Bait and Tackle FB
2 Avery's Aviary AA
3 Zelda's Crochet Shop ZC

The user chooses "Fred's Bait and Tackle" in the Org Name menu, the Org ID
field should show "FB". If "Zelda's Crochet Shop" then Org ID should be
"ZC",
etc.

Does that provide enough info to explain what I'm trying to do? With
InfoPath, I could do it pretty easily - but my new users don't have
InfoPath,
so I'm building this in Access and will be splitting the DB.

Thanks in advance for any help, advice, pointers y'all might have!

Mike


 




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


All times are GMT +1. The time now is 06:28 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.