bound form with unbound fields needing updating to the same record

G

Guest

I'm looking for an idea here to see if I'm approaching this correct. I have
a form that references a table. Pretty much all the fields on the form are
found to the fields on the table so the user can adjust the values if needed.


I'm having issues with one unbound field on this form and am not sure if
there's a better way to approach this. The one unbound field is for the user
to enter in the name of whom is approving the above data. I have a save
changes button where I want to update the record (that all the bound fields
are using) to populate the data entered in the unbound field and just an exit
button that is not supposed to save changes; if the exit button is pressed, I
don't want the approved name to be saved. As it is now, the save button runs
an openrecordset behind the scenes and when it executes, I get something
about the record or object is readonly. I primarily used the unbound field
because I wanted to ensure the name of the approver wasn't populated unless
it really was approved.

Please help. I'm still reviewing my options and can really use some insight
on my approach.
 
J

John W. Vinson

I'm looking for an idea here to see if I'm approaching this correct. I have
a form that references a table. Pretty much all the fields on the form are
found to the fields on the table so the user can adjust the values if needed.


I'm having issues with one unbound field on this form and am not sure if
there's a better way to approach this. The one unbound field is for the user
to enter in the name of whom is approving the above data. I have a save
changes button where I want to update the record (that all the bound fields
are using) to populate the data entered in the unbound field and just an exit
button that is not supposed to save changes; if the exit button is pressed, I
don't want the approved name to be saved. As it is now, the save button runs
an openrecordset behind the scenes and when it executes, I get something
about the record or object is readonly. I primarily used the unbound field
because I wanted to ensure the name of the approver wasn't populated unless
it really was approved.

Please help. I'm still reviewing my options and can really use some insight
on my approach.

Please post your code. I don't see why opening a recordset is either necessary
or appropriate, nor why you have the person-approving field unbound! Why not
make it a bound field, and have a Cancel button which runs:

Private Sub cmdCancel_Click()
Me.Undo ' undo all changes to the form
End Sub

John W. Vinson [MVP]
 

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