Subform examples

I am completely new to subforms in Access 2007.

I created a main parent table. Fields ID (PK); Assessment No.

I then created a form on that table.

I created a risk phrase table table. Fields ID (PK); Risk Phrase; Assessment No.

I opened the form and then craeted a subform based on my risk phrase table.

It all seemed to work ok.

I decided that it would be good to have a dropdown option in the subform so that I always chose items from the risk table (i.e. limited to the options only in the risk phrase table.

So, in the subform design view, I right clicked on the control 'risk phrase' and used the option 'change to - combo box'.

All seemed ok until I started to populate the database. Then I realised the dropdown option was growing. For instance, instead of being only 5 options to choose from, the same options were appearing over and over, mirroring what I was adding to each record.

What I want is to use a dropdown list that stays as originally written - e.g. just 5 options.

Can anyone point me in the direction of a good example database that I can look at, that utilises dropdown selections. Hopefully by looking at an example I might understand where I have gone wrong.

Many Thanks

Ron

Hi,

please paste here the combo-box data source query.

Mimmo

Se la risposta ti ha aiutato "Vota Utile".
Se ha risolto il problema "Segna Risposta.
Rome, Italy

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

It sounds like you are querying the same field  that you are entering data into. This is usually not the way. What you should do is have a separate look up table of the five values. And the RowSource of your combo should query that lookup table. The CONTROLSOURCE of the combo would be the field in your table.

By the way, this has nothing to do with subforms. This is how a combo is used whether its on a subform or not.

Hope this helps,
Scott<>
Blog: http://scottgem.wordpress.com
Microsoft Access MVP since 2007

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

I have attached a screenshot. Please let me know if this is not what you expected.Image

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

As I said, you are selecting the field you are entering data too without any restrictions. Plus you have Limit To List set to No, so the user can enter anything they want. 

The proper way is to use a lookup table as I suggested and set Limit to List to Yes.

Hope this helps,
Scott<>
Blog: http://scottgem.wordpress.com
Microsoft Access MVP since 2007

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

As far as I can see, what you have is a many-to-many relationship type between Assessments and Risk Phrases.  This should be modelled by a third table, so, in broad outline, your tables would be:

Assessments
....AssessmentID  (autonumber PK)
....AssessmentNumber (indexed uniquely)

RiskPhrases
....RiskPhraseID  (autonumber PK)
....Risk Phrase (indexed uniquely)

and to model the relationship type:

AssessmentRiskPhrases
....AssessmentID  (FK)
....RiskPhraseID  (FK)

The primary key of the last table is a composite one comprising both columns.  Diagrammatically the model would be:

Assessments----
________________________________
Ken Sheridan,
Newport, Shropshire, England

"Don't write it down until you understand it!" - Richard Feynman

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

 
 

Question Info


Last updated March 31, 2025 Views 329 Applies to: