Dynamic Caption?

jander37

New member
Local time
Today, 03:23
Joined
Jul 12, 2013
Messages
2
Hey guys. I am taking my final Access class at college and everything has gone well until we started using VBA. I am a complete novice to it and would like a little help. Someone already posted a question very similar to mine but I think because my database is a little different it isn't working properly. Here is the assignment from the teacher:

You will be modifying the frmMainMenu to call the caption of each button from the table MainMenu and form or the report.

1) Create a table MainMenu with at least 3 fields: ID, caption, and form or report to run

2) Your code (for the button) will dynamically read the caption from the table and assign it to the button

HINT: Variables (table name) in other areas of the code should not be "hard-coded". If for example a Table name changes in the database it should be reflected in the menu. I do not need to go into the code and look for all entries for the hard-coded name of the table. Dynamic caption means should the name of any table change – the caption on the button for that table must change as well. Test it out …

3) Your code (for the button) will dynamically read the form/report name and will run when you press the button.

HINT: Like the hint for #2 above do the same for the reports. No names should be hard-coded. This prevents errors in the long run which often break a program, and maintenance does not become a nightmare!! This approach is a widely utilized practice amongst professional developers in support of friendly user experience enhancements! Our users want to be able to press buttons that are logical, practical, and smart.

I encourage you to search the Internet to find resources to help you solve the exercises. These resources may be helpful!

In order for me to get some sort of clarification from the professor I asked the following questions and here is his answers:

Hello Jason,

This assignment is to be completed using VBA scripting...

1. We make another table and name it MainMenu? We put 3 fields in it (ID, caption, and I'm assuming another field named form or report)? What data do we put in each field?

ID = A number, an identifier

Caption = The identifier from the form/table you want to bring up

Name of report = Name of report

2. Do we add another button onto the existing main menu form?

No, the idea is to not hard-code the forms but use a table to read in the table/report/form name and then display it.

3. No

4. Hard coding is not using the GUI in Access to drag and drop the items

5. You will have to some research on the internet and I have included some to get you started

6. VBA

On Jul 11, 2013 at 5:51 PM, Anderson, Jason wrote:
Professor,
I have talked to a few of the other students and I think the majority of us have no clue what or how to do this week's assignment (me included). I have a few questions that I hope you can clarify for me.

1. We make another table and name it MainMenu? We put 3 fields in it (ID, caption, and I'm assuming another field named form or report)? What data do we put in each field?
2. Do we add another button onto the existing main menu form?
3. Should the button change just for the new table that we created?
4.What is hard coding?
5. The textbooks say nothing about dynamic caption.
6. Do we use the expression builder? Make modules? VBA? SQL?

I've read the links you had on the assignment numerous times and I understand that we will use the DLookUp to get the value of the caption but I don't know where to start from there.

I'm assuming that when I click (an on click event) on a button in my form that it would execute the referenced table information. I'm not looking for someone to do my homework by no means, but I have exhausted all of my resources and am becoming frustrated so if anyone can offer me some advice I would greatly appreciate it.

I can't attached a copy of the database because it is over the 2MB limit (5MB), but I can email it out if someone is willing to help me out. The main menu table has been created.

Feel free to chop up my sorry little database to make it work properly. Again, thank you guys in advance.
 
Are you sure you searched the Net as your teacher suggested.

Out of the six questions you don't know the answer to any one of them. I don't mind helping however as this is a school assignment I think you shoud at least try a little harded.

Surely you should be able to find out what Hard Coding is.
 
Jason, were you ever able to figure this out? I'm in this class now and got basically the same help from the "professor" as you...search the internet. If you found any decent links or could share how you did it, that would be great. I'm not finding much in searching.
thanks!
 
Guys

There has not been one piece of feedback to demonstrate that you have done anything other than ask for a free ride.
 
Agree totally with Rainlover - seems to me the prof gave him info and hints. As Brian showed, even a simple Google/Bing search would get you way past a starting point. We haven't seen one thought/concept/attempt from these posters!
 
You are in your final Access class and you have not used DLOOKUP whilst in the course, AMAZING

As previous posts stated use the Internet and search for results. In the "real world" no one is going to solve your problems unless you put in some effort.

Your database size is 5MB have you done a Compact and Repair?
 

Users who are viewing this thread

Back
Top Bottom