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  

Change label caption based off value in table



 
 
Thread Tools Display Modes
  #1  
Old October 15th, 2009, 06:49 AM posted to microsoft.public.access.forms
Matt P
external usenet poster
 
Posts: 39
Default Change label caption based off value in table

I want to be able to allow users to change 3 category names by going
into a form and then typing in the new name. So I have labeled these
three categories Misc1, Misc2, and Misc3. The problem I have is how
do I access the table to find the values I need? The other form and
underlying table are already setup. I just need the code to find the
value "Misc1" and then the corresponding new name

Any suggestions? Thanks!

-Matt
  #2  
Old October 15th, 2009, 01:40 PM posted to microsoft.public.access.forms
Linq Adams via AccessMonster.com
external usenet poster
 
Posts: 1,474
Default Change label caption based off value in table

I'm a little fuzzy as to your purpose here, but assuming you only have one
record in you "Misc" table, you can use the DLookup() function without the
Where clause:

Private Sub Form_Load()
Label1.Caption = DLookup("misc1", "MiscTable")
Label2.Caption = DLookup("misc2", "MiscTable")
Label3.Caption = DLookup("misc3", "MiscTable")
End Sub

--
There's ALWAYS more than one way to skin a cat!

Answers/posts based on Access 2000/2003

Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...forms/200910/1

  #3  
Old October 17th, 2009, 07:48 AM posted to microsoft.public.access.forms
Matt P
external usenet poster
 
Posts: 39
Default Change label caption based off value in table

On Oct 15, 7:40*am, "Linq Adams via AccessMonster.com" u28780@uwe
wrote:
I'm a little fuzzy as to your purpose here, but assuming you only have one
record in you "Misc" table, you can use the DLookup() function without the
Where clause:

Private Sub Form_Load()
*Label1.Caption = DLookup("misc1", "MiscTable")
*Label2.Caption = DLookup("misc2", "MiscTable")
*Label3.Caption = DLookup("misc3", "MiscTable")
End Sub

--
There's ALWAYS more than one way to skin a cat!

Answers/posts based on Access 2000/2003

Message posted via AccessMonster.comhttp://www.accessmonster.com/Uwe/Forums.aspx/access-forms/200910/1


Thanks Dlookup was exactly what I was looking for!
 




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 02:37 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.