Change label caption based off value in table

M

Matt P

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
 
M

Matt P

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!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top