Populating combo box


G

Guest

Hi there, I have a main form (frmmain) with a combo box (cmbsitename)- with
different companies in it. Once the company has been chosen it then fills in
the rest of the form (fields that are locked), I then want to be able to edit
this data, so I click on a button (cmdsave) and it opens another form
populated with the same data (apart from edits are allowed). If I want to
change say the postcode I then make the necessary changes and close the form.
I then want the form to be refreshed or requeried to show the new data. At
the moment, on the onclick event of the save button I am requerying and
clearing the value in the combo box,so that when the user reselects the
company; the new data is shown. Here is my code -


Private Sub cmdSave_Click()
DoCmd.Close
Forms!frmmain!cmbsitename.Requery
MsgBox "Site Details Changed, please reselect Site Name" & vbCrLf & "from
Dropdown for changes to take effect", vbOKOnly, "Site Details Changed"
Forms!frmmain!cmbsitename = Null
End Sub
 
Ad

Advertisements

Ad

Advertisements

G

Guest

hi,
I think you need to requery the combo box.
me.combo1.requery
look up the requery action in help for more details.
 

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