Updating control

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I'm a bit confused..I've looked through the questions about updating from a
control box so it can update the field in the table and spend more than half
a day on it but I cant seem to understand or find the solution.

I have a control box, which is unbound although in the Form Load event it
gets the value from a table through a query.

I want the user to be allowed to change this value (its a word). So far I
have done this but whenever I edit the control (txtbox) and if I click on
anything else on the form it goes back to its old value on the table.

So is it possible to edit the value and save it back to its relevant field
on the table? If so, how?

Thanks,
Saima
 
Is there a reason why you don't use bound forms with bound text boxes? If
you have a value placed into an unbound text box which somehow "goes back to
its old value", there must be some code or something running.

You haven't share any code or reasons for your setup.
 
Yeah sorry, there is code. My first action was to bound it by setting the
property control source of the textbox but I have read that the user cannot
edit that field if its bounded?

The code is in Form Load and its

Private Sub Form_Load()
Me.txtLMILogin = Me.txtCompanyID.Column(1)
End Sub

where txtLMILogin is the textbox, and the txtCompanyID is the combo box that
uses the query. Column one is just the column of the query that I wanted to
use. The form in which all of this is frmLMI.

I wasn't sure what do I need to do in order to update. Would I need to
update the query or can I just code something. Basically what I want it to do
is to bring the record if its there in the database and update it in the
table if its changed in the form.
 
The Query contains the companyID, LMI Login and LMI Password as its field.
The CompanyID is passed as the opening argument for the frmLMI.
 
Back
Top