Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

temporarily "unbind" forms

Status
Not open for further replies.

belovedcej

Programmer
Nov 16, 2005
358
US
Okay - I might be totally crazy - but here's what I want to do.

I have an SQL Server backend and Access adp front end.

I don't want to lose the find features or the other conveniences of having a bound Access form. But our policy here is to not allow users update permissions to the server. Instead, we write stored procedures and activate them with a "save" button in order to update/add a record. The programmers all use .NET - I'm the newbie who uses Access - so their methods don't work for me. I don't know what they do.

I want to bind my forms to a view, providing the users with read-only access to that view.

Then, when the user presses the "edit" button, have the form "unbind" but keep the data for that single record.
After they update the record and press save, edit mode ends, and the form should be "rebound" again.

Of course, I would want something similar for adding a record, too - just clearing the fields instead of keeping anything.

Is this even possible without actually building a whole new form for this that I would open just for edits or adds? I don't want to do that if I don't have to - that makes the app a lot larger.
 
You can disconnect recordsets from the source. There are probably multiple ways to implement this. Look up disconnected recordsets.

Here is 1 way you can give a try.
1.When creating the Form bind to your view to place the names on the Form.
2.After your Form is created it will have a recordset object.
3.In the OnOpen event, take your original SQL that was used to build the Form and create an SQL string to send to sql server.
4. Bring the SQL string data back to another recordset that you define in the OnOpen event.
5. Set the Forms recordset to the new one you created.
i.e Set Me.Recordset = yournewrecordset
6. disconnect the new recordset from the source.
i.e. Set yournewrecordset.connection = Nothing
7. At this point you are no longer connected to the source but the Form will behave as if you were updating the source.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top