Control Cannot be edited its bound to the expression

nickmumby

New member
Local time
Today, 00:59
Joined
Dec 2, 2009
Messages
4
New To access and I'm having a problem with a form.

I have 2 related tables.
I want to produce a form where I can use a combo to select a machine number and view the related fields from both the related tables in text boxs below.

I have done this but cant edit the data;
'Control Cannot be edited its bound to the expression'

in the txt boxes im using;
=[<Combobox>].Column(3)

For the combo box I have just created a simple query showing the two related forms.

Select <TableName>. [<columnname>], <TableName>. [<column2name>] ... etc


many thanks!
 
...in the txt boxes im using;

=[<Combobox>].Column(3)
You're apparently using

=[<Combobox>].Column(3)

in the textbox Control Source, and as Access has told you, you cannot edit data when it has its Control Source set to an expression!

In order to do this and be able to edit the field, you need to do the assignment in the combobox AfterUpdate event:
Code:
Private Sub ComboBox_AfterUpdate()
 Me.TextBoxName =[<Combobox>].Column(3)
End Sub
 
thankyou! I feel like im making some progress now.
Seem to be having a problem still,

Private Sub Cbo_DevName_AfterUpdate()
Me.txt_address = [Cbo_DevName].column3
End Sub

Cbo_DevName is the combo
txt_address is the txt box

I get..
Compile error:
Method or data member not found

Cbo_DevName
Control Source ----------
Row Source - VX6 Query

I have just created a simple query with 6 columns from 2 related tables.
From what I understand it cant reference the other columns in the table. If I remove 'Column3' from the expression it does work but obviouisly it only fills the txt box with the same data thats selected in the combobox.
 
Last edited:
ok got a little further and seem to have it working.
I just recreated the main combo and it seemed to start working.

thanks missinglinq!

now I just have to work out how to create a button that saves the fields in the query back to the original table one I have modified them.
 
Ive been having a go at changing the data in the query from the text fields but im having a problem;

Ive created an update query(VX6QUpdate) that writes the data from the query(VX6Query) back to the form (VX6) once it is run.

This works fine and if I edit the data in the query(VX6Query) directly, run the update query the new data appers in the table(VX6).

What Im struggling with is getting the text boxes that have previously been populated with data from VX6Query to update VX6Query when they are modified.
Then the plan is to use a save button to run the Query Update to write it back to the table.

Private Sub Cbo_DevName_AfterUpdate()
Me.txt_address = [Cbo_DevName].Column(1)
Me.txt_mac = [CCbo_DevName].Column(2)
Me.txt_serial = [CCbo_DevName].Column(3)
Me.txt_card = [Cbo_DevName].Column(4)
Me.txt_vehicle = [Cbo_DevName].Column(5)
Me.txt_notes = [Cbo_DevName].Column(6)
End Sub

Private Sub txt_address_AfterUpdate()
Me.Cbo_DevName.Column(1) = Me.txt_address
End Sub
 

Users who are viewing this thread

Back
Top Bottom