Refresh bound field on form when new data added

N

Noemi

Hi

I have 2 tables (tbl_Client & tbl_Timesheet)
tbl_Timesheet has a field called Client which is linked as combobox to
tbl_Client (this allows user to select the client rather than retyping the
same client over and over)

I then have a form which has tbl_Timesheet in a subform on a tab control.

I have created a textbox so that if we have a new client we can type the
name into the text box and update the tbl_Client table however I am not sure
how to refresh the tbl_Timesheet table which is visible on the form so once
the new name has been entered and an update button clicked, it adds the new
name but also makes it available in the drop down box so person entering in
data can now select the new name.

I hope the above makes sense and someone can help
 
M

Mr. B

Noemi,

Check out "OnNotInList" event and "Limit to List" properties of your combo
box in the Help file of Access.

Using this built-in functionality of Combo Boxes is the prefered way of
doing exactly what you are trying to do and the list will be updated.
 
N

Noemi

Hi Mr B

I have looked at both OnNotInList and Limit to List.

I dont think I can use Limit to List as I have reference the table/query for
the combobox so we can select fromt he Client table and if I read the help
correctly you need to have the RowSource as Value List.

I really dont understand the OnNoInList, can you help me with this.

What I have a a command button that when it is clicked the the name from the
text box gets added to the client table but I am not sure how to get the
combobox which references the Client table to show the new name.
 
N

Noemi

Mr B

I worked out how to do it, thanks to another entry.

me.frm_TimeSheet.Form!cboClient.requery

The above was placed into the button event after the add new name into
tbl_Client.

Works great.

Thanks for your help
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top