combobox not refering to correct field.

merlin777

Registered User.
Local time
Today, 12:51
Joined
Sep 3, 2011
Messages
193
Please can someone remind me the settings for achieving the following?

I have a form which contains fields from my main table and also has a subform containing a query based on a filtered list of my main table.

I have a combobox on the form to select a name and pass it to the query to filter on.

The list of names is in a table called tblnames which has 2 fields, name and ID. I have linked the ID field on this table to a field called nameid on my main table which is a numeric field (and that allows be to select a name from a list when I enter data into my main table.

The xox is unbound, control source empty and row source set to tblname.

The combobox is only showing a list of numbers (I assume they are the id field from tblname). Yesterday I had the list of names showing and I checked a backup and the only difference I can see is the row source property refers to the name field in tblname but I don't know how I got it there. When I click on the list box for row source I only get offered a list of my objects.

Can anyone see where I'm going wrong please?
 
i've just asked you the same thing in my other thread!

I'll read the article but I think i can be more concise:

How do you point an unbound combobox in a form at a particular field in a table?

I think its the row source property but its only offering me a list of objects, not fields.
 
In attachment you will see a combo.
Look at the properties of this combo, especially under "Data" tab but also under "Format" tab (ColumnCount and ColumnWith properties)

Is this what you are looking for ?
 

Attachments

I'm trying to understand what's going on from your example.

By putting something in the control source property you are binding the combobox to the 3rd column in table1?

For me the equivalent would be a field called lastname in table tblpatients. If i make that the control source it doesn't work. My main table has a field called patient which is linked to tblpatients. If i make that the control source the combobox works but i dont understand why! I can see that using 'patient' will point to tblpatients but how does it know which field? Does this mean that 'patient' has to be on the form (visible or invisible) and that it must be linked tp tblpatients?

I'm still struggling a bit. May i post mine for you to look at?
 
Of course you can. Be aware that I use 2007
 
Last edited:
I'm on 2007 too.

the form tblappointment1 is a copy of the original form tblappointment that i made to experiment with after your post.

the form tableappointment is intended to enter data into the table tblappointment whilst displaying tableappointment query3 in a subform. this query is a filtered list of the main table (and a calculated field). I'ts parameters come from the combobox and date box on the form. I've got the query working but can't get it to display in the subform.

I got the combobox working by fiddling - i just don't understand how!
 

Attachments

Now I must go to my workplace.
Try to recalculate the AppDuration.
The key should be the DateDiff function.
Let me know if I am close of your needs.
 

Attachments

Thanks, Mihail. It's given me loads of questions!

I can't see where you select the name and date to filter to query in the subform.
What was I doing wrong with the subform?

That'll do for now!
 
Thanks, Mihail. It's given me loads of questions!

1) I can't see where you select the name and date to filter to query in the subform.
2) What was I doing wrong with the subform?

That'll do for now!

1) Click your subform (in the main form - design view) and take a look to the "linked fields" (properties panel).
I don't make a selection about date. In my opinion is not necessary. While you see all the appointments for a person, sorted by date (ZA), should be very simple to scroll down the subform in order to see what happened at a certain date.

2) Is quite impossible for my English to explain this. Sorry. Maybe will be another one that can do that.

Note please how I (re)name your fields in the table/query and your controls in the form. This make my work a lot easier.
Also note that Access can encountered troubles if you use spaces in the names.
So, my name, Mihail Trandafir (with spaces) is as easier to read (for a human) if I write it without spaces: MihailTrandafir. But the last form is a lot easier to read for Access.
 
Thanks Mihail. I will need to select the date as one person may have many booked appointments and i'd prefer them not to need to scroll.

I managed to get the subform to display properly by removing the parent child links.

I'll work through your example a bit more today.
 

Users who are viewing this thread

Back
Top Bottom