Edit/add records

pd06498

Registered User.
Local time
Today, 19:40
Joined
Dec 30, 2003
Messages
80
I have two forms set up in a database, both linked to one table. They are the same form except one is used to add & edit records, while the other is used to search and look at records.

The add/edit form defaults to new record when opened. This is fine.

I want to be able to search for a record in the search form, and once a record is located click on a button which will open the add/edit form at the record selected in the search form. I also want to close the search form at that point.

Is this possible? If so, can someone point me in the right direction.

Thanks in advance.
 
pd06498 said:
I have two forms set up in a database, both linked to one table. They are the same form except one is used to add & edit records, while the other is used to search and look at records.

That sounds like a long way to get to the conclusion.

I may have misinterpreted though. Is this example what you mean?
 

Attachments

Mile-O

Thanks for the reply. Not quite what I have (I think). My add/edit form is the form I use to add original data. The search form is a copy of this form except the user is unable to add or edit or delete records from it. I just want to add a button to this search form to enable that record to be showing and edited in the original (add/edit) form. If the add/edit form is opened from other means (i.e. from a command button on the menu form) then the add/edit form opens ready to add a new record.

I hope I have explained this clearly enough. If not, I can send you a copy of the db.

Thanks
 
On the example, look at the code behind the EDIT button. Therein lies your solution. :cool:

Two identical forms seems a bit much, though.
 
Mile-o

Point taken. Will look at alternative. Thanks for your help.
 
I picked up the following idea from a Smart Access newsletter and have adapted it.

Basically if you start creating multiple forms to operate on the same table or query, then you have a nightmare when you want to make a small change.

Let’s say you’ve made three forms to perform on a table, one for adding data, one for looking up data and one for editing data. Now you suddenly find that you need to add a couple of fields for some extra data. You have to modify all three forms.

So if you can, Use this technique, have one form, and change it’s look and function when you open it.

I've put an example on my website, Download the "One Form Example"
 

Users who are viewing this thread

Back
Top Bottom