Select a row from a subform

AndySuk

Registered User.
Local time
Today, 00:33
Joined
Jan 17, 2007
Messages
23
Hi

Is it possible to select a row from a subform? The subform is not bound to any table; it displays lines of expenses that are entered into the main form.

What I wish to do is to be able to select a row or record from the subform and thus identify that record in order for it to be deleted.

Many thanks

Andy
 
How can you have a subform UNBOUND and yet have a record to delete? That doesn't quite sound right to me. Can you post a screenshot to show what you're talking about? (please upload it here and not to a file sharing site as those are blocked by my workplace).
 
Hi Bob

I've attached a screen shot. The thinking behind it is that the subform is based on a query which queries the expenses table for all records relating to the emplyee and month which is shown on the header of the main form.

As expenses are entered there is some slq attached to the click event of the add record button which enters the data into the expenses table and then requeries the subform.


The delete button should take the Exp_id of the selected row and then delete the record with that id from the expenses table.

Many thanks

A
 

Attachments

  • Expense form.jpg
    Expense form.jpg
    94.7 KB · Views: 204
If the subform is based on a Query then it is a Bound Form! Forms can be bound to Queries as well as Tables. If a record is deleted from the Query it will be deleted from the Table as well.

Have you actually tried deleting a record and failed? If you open the Query independent of the Form, can you delete a record from it? If not then the underlying Query is Read-Only. Allen Browne has an excellent short page addressing this problem:

http://allenbrowne.com/ser-61.html
 
Last edited:

Users who are viewing this thread

Back
Top Bottom