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
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