unbound txtboxes updating table

  • Thread starter Thread starter Chris
  • Start date Start date
C

Chris

hello group

I have a cboBox that contains area's e.g. Glasgow, Edinburgh. When the user
selects an option the 3 textboxes are populated with the street name, town
and Postcode.

When I change the address i would like the new address to be stored in the
table.

textboxes are unbound.

cboBox (cbocredBranch) based on tblCreditorAddresses

tblCreditorAddresses (CreditorAddressid, creditorBranch, address1, address2,
postcode)

I've been trying the following

Set rst = db.OpenRecordset("tblCreditorAddresses", dbOpenSnapshot,
dbReadOnly)
rst.FindFirst "[CreditorAddressID] = " & Me.cbocredbranch.Value


Me.TxtAddress1.Value = rst![Address1]
Me.txtAddress2.Value = rst![address2]
Me.txtPostCode.Value = rst![postcode]

On the Form_close event
I've been trying rst![address1] = me.txtAddress1.value

I keep getting different messages telling me that it's read only


HELP I NEED SOMEBODY, HELP NOT JUST ANYBODY, HELP.....
 
Chris said:
hello group

I have a cboBox that contains area's e.g. Glasgow, Edinburgh. When the user
selects an option the 3 textboxes are populated with the street name, town
and Postcode.

When I change the address i would like the new address to be stored in the
table.

textboxes are unbound.

cboBox (cbocredBranch) based on tblCreditorAddresses

tblCreditorAddresses (CreditorAddressid, creditorBranch, address1, address2,
postcode)

I've been trying the following

Set rst = db.OpenRecordset("tblCreditorAddresses", dbOpenSnapshot,
dbReadOnly)

Look at your last line above. You are specifying that the Recordset being
opened use Snapshot as the RecordSet type and further specifying the
ReadOnly option and then you are trying to edit data in it. Either one of
those settings will prevent writes to the data.

Use dbOpenDynaset instead.
 

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

Similar Threads


Back
Top