newbie question - how to use listbox

LisaB

New member
Local time
Today, 09:16
Joined
Jul 6, 2010
Messages
6
Hi,

I'm designing my very first Access app! Two of my table are Reports and ReportTypes. There are only 4 records in ReportTypes and this is unlikely to ever change. Here is my table structure:

ReportTypes table only has 2 fields:
ReportTypeID
ReportTypeDescription (8 char)

Reports table:
ReportID
ReportName
ReportTypeID
Attribute4
Attribute5
etc.

There are only 4 records in ReportTypes and this is unlikely to ever change. Here's my INCREDIBLY green novice question . . . how should I design a form to add new reports? The standard master/child subform that the wizard creates puts the control to add new ReportTypes top and center, but new ReportTypes are probably never going to be added.

I think I want some kind of a datasheet style form where the user can add new reports and select from some kind of a listbox or combobox to enter the field ReportTypeID, but I can't seem to get it working. I want the user to be able to choose from a list of ReprtTypeDescription values, not ReportTypeID values.

Please help a newbie!

thanks,
Lisa
 
Hi,

I'm designing my very first Access app! Two of my table are Reports and ReportTypes. There are only 4 records in ReportTypes and this is unlikely to ever change. Here is my table structure:

ReportTypes table only has 2 fields:
ReportTypeID
ReportTypeDescription (8 char)

Reports table:
ReportID
ReportName
ReportTypeID
Attribute4
Attribute5
etc.

There are only 4 records in ReportTypes and this is unlikely to ever change. Here's my INCREDIBLY green novice question . . . how should I design a form to add new reports? The standard master/child subform that the wizard creates puts the control to add new ReportTypes top and center, but new ReportTypes are probably never going to be added.

I think I want some kind of a datasheet style form where the user can add new reports and select from some kind of a listbox or combobox to enter the field ReportTypeID, but I can't seem to get it working. I want the user to be able to choose from a list of ReprtTypeDescription values, not ReportTypeID values.

Please help a newbie!

thanks,
Lisa

Lisa,

If it were me, I would use a combo box to select the report type. You can hide the column for the ReportTypeID .

This may also help:

Report Dialog Examples

*PS: You can import this into your database and use it.
 
Last edited:
Thx, Boyd, for quick response.

The problem is that I've never set up a combobox before and don't know what I'm doing with them. (It's not that I'm completely untechnical -- I have experience as a Cobol programmer and doing tech support.)

Here's two things I experiemented with:

1. Set up the ReportTypeID field in the Reports table to be a lookup field that looks up the values in ReportTypes. Then I created a datasheet style form based on the Reports table only. Now when the user enters a new Report, a listbox appears for the ReportTypeID field.

This solution is ok except doesn't give user any way to enter a new ReportType.

2. Created a new form based on Reports and added to it a combobox control by dragging the combobox icon onto the report in Design View then responding to the little wizard that follows. The label that Access put in for me says Unbound.

Now this form has this problems: The combobox displays the values of ReportTypeDescription to choose from but when I try to enter a new one I get a message that says "The text you entered isn't an item on the list. Select an item from the list or enter text that matches." What do I need to do to allow a new ReportTypeDesc to be added that will update the ReportTypes table and put the new ReportTypeID into the new record in Reports? Btw, I set up all my tables so that the primary key is a single field that is autonumber.

Obviously, these are very ignorant, green questions . . . would be very appreciative of any help.

Lisa
 
Thx, Boyd, for quick response.

The problem is that I've never set up a combobox before and don't know what I'm doing with them. (It's not that I'm completely untechnical -- I have experience as a Cobol programmer and doing tech support.)

Here's two things I experiemented with:

1. Set up the ReportTypeID field in the Reports table to be a lookup field that looks up the values in ReportTypes. Then I created a datasheet style form based on the Reports table only. Now when the user enters a new Report, a listbox appears for the ReportTypeID field.

This solution is ok except doesn't give user any way to enter a new ReportType.

2. Created a new form based on Reports and added to it a combobox control by dragging the combobox icon onto the report in Design View then responding to the little wizard that follows. The label that Access put in for me says Unbound.

Now this form has this problems: The combobox displays the values of ReportTypeDescription to choose from but when I try to enter a new one I get a message that says "The text you entered isn't an item on the list. Select an item from the list or enter text that matches." What do I need to do to allow a new ReportTypeDesc to be added that will update the ReportTypes table and put the new ReportTypeID into the new record in Reports? Btw, I set up all my tables so that the primary key is a single field that is autonumber.

Obviously, these are very ignorant, green questions . . . would be very appreciative of any help.

Lisa

Lisa,

I started our programming in Cobol on Big Blue Iron before PC's. The switch to Object Oriented/Event driven programming was a real challenge.

For creating the combo box, I would use the Combo Box control wizard. It is one of the few wizards I use it a lot.

Did you get a change to look at the example in the link I provided?

You will find an example of exactly what you are trying to create. You can import it into your database ot just learn by looking at the design.
 
Thx for the link. It looks useful and will be what I look at next. I must have tried the combobox wizard 15 times by now and I can't get what I want -- where could I find documentation on how to use or a tutorial that is free?

Yes, the learning curve from procedural to event driven programming IS steep . . .

Thanks,
Lisa
 
Lisa,

From a resent thread, I wrote:
I also came from COBOL to Windows programming. It was a huge leap to change my thinking to events and objects.

With Access you do not usually have to write lots of code. I like to say I "sprinkle code in events".

What really helped me was to learn the order events fire. Once you understand what causes different events to fire, it makes a lot more sense where to "sprinkle" some code.


I also found this very helpful:

Access 2002 Developer's Handbook Set
 
Last edited:

Users who are viewing this thread

Back
Top Bottom