MS Access Switchboard With Dynamic Labels

G

ghadley_00

Hi,

Is there a way to have the labels in a MS access database switchboard
dynamically generated based on values in a table? I have a table of
items (let's call it table Main) , each of which is assigned to a
category. The list of categories is stored in a separate linked table
(let's call it Categories). The Categories table consists of entries
that have an ID number and a name.

I have made queries of the Main table where I make the search criteria
the ID number for the category of interest.

I then made a report for each of these queries.

I would like to make a switchboard that has links to the reports I have
made (one for each category, which is a fixed number), but I would like
the text labels for each of the options to be the description listed
for each entry in the Categories table.

In essence, is it possible to create a switchboard which can
dynamically generate its text labels based on fields in a table?

Any help that could be provided would be greatly appreciated.

Best wishes,

George Hadley
(e-mail address removed)
 
M

Martin

One function you could use is Dlookup("fieldname you're looking up", "table
you're looking up", "criteria"). This could be programmed into a VBA
procedure that's triggered by a suitable event, like the form's Load or
Current event. Alternatively, if you don't like VBA, a quick-and-dirty
method would be to use textboxes rather than labels and type =dlookup
functions in these (you could make sure the textbox's Enabled property is set
to No to stop users being able to cursor into them).

Remember to put the double quotes around each argument in Dlookup. A
typical criterium would be: 2CategoryNumber=Forms!Switchboard!CategoryNumber"
 

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