add a new item to a value list

jamesgonzo

Registered User.
Local time
Today, 12:04
Joined
Jun 1, 2003
Messages
12
When I first created the database I created a look up field and I added the names of the schools I wanted to be able to click on. Now I would Like it to be possible to add new items and for it to be updated automattically to the value list. I have been working on this for 2 days now and am still having difficulty. I've gone through what seems like every post covering this area, but I was unable to find one that was about automaticall adding to a value list.
Is this even possible, will I have to add a new combo box so it can the row source type can be a table/query.

And since I am using a value list, my row source is a list of schools I have already entered.

thanks for your help

Here's the db just in case I was unclear.
 

Attachments

Hi,

Do the following:

1) On the DOuble CLick Event of the combo box enter the following code:

docmd.openform "Your Location Form"

2)On the ONclick event of the combobox enter the following code:

me.recordsource.refresh

This will open your Location form, so that the data can be added, then when you reclick the combo the recordsource for the combo refreshes, putting the value in the list.

HTH

Andy
 
Thanks for the reply, but when I tried the me.recordsource.refresh
it gave a compile error, is that the only line of code I should enter or should that work?
thanks
jim
 
Go into VBA and the code should look like:

Private Sub Your_Combo_box_name_Click()
Me.RecordSource.Refresh
End Sub

Andy
 
thanks PAT AND SPACEPRO,
I'll give it a shot and if you don't mind I might need some assisstance throughout the process.
thanks
jim
 
Private Sub School_Location_Click()
Me.RecordSource.Refresh
End Sub


This is exactly what I have in the code (is this correct?), but an error still occurs.
jim
 
You will need to create another table as Pat suggests. Missed that one, then use the code I supplied to accomodate new entries into that table.

Andy
 
Private Sub School_Location_Click()
Me.RecordSource.Refresh
End Sub


This is exactly what I have in the code (is this correct?), but an error still occurs.
jim
 
Does this mean I will have to link my tables for some of my queries to perform?

Or will I will able to use them independently?
 
No you don't need to link the tables.

Just change the table structure, as spoken about.

Andy
 
jamesgonzo said:
Does this mean I will have to link my tables for some of my queries to perform?

Or will I will able to use them independently?


Yes you will if you use the look up tables correctly
 

Users who are viewing this thread

Back
Top Bottom