Full Version: Populate form for editing
UtterAccess Forums > Microsoft® Access > Access Forms
rkg
I've been using the same dBase iv program since the late '80s to enter, edit, and print reports from our database. I've done everything to switch over to Access 2007 but I can't quite get one thing to work. I need a form for the user to enter a ticket number then populate the form for editing the record. Since all our records have a unique ticket number I have used it to index on in dBase iv but since I used the ticket number to index on it was the one thing I couldn't edit. I would like to find the record and be able to change any of the data. I guess what I'm asking is how do first populate the form based on a query and second make sure every field can be edited. I suppose I need a seperate field for indexing.
Thanks for any help you can give me.
Greenbank
Doug Steele
Access doesn't prevent you from changing values just because the field is the record's primary key. Is the problem that you've got foreign keys in other tables pointing to the Ticket Number, hence you can't change it?
You could always use Cascade Updates to propagate changes to Ticket Number, although adding an Autonumber ID to the table and then using that Autonumber ID as the foreign key in all the other tables might be safer.
rkg
Thanks for the quick reply. I hadn't even tried to edit all the fields from a form in Access yet. That is good to know. I only have one table to work with so no problem with foreign keys. Is there an easy way to use a form to query the table and populate the fields for editing? I must be easy to do but I wrote my dbase program so long ago I haven't given it much thought as you can probably tell.
Thanks,
Ron
Doug Steele
The easiest way is simply to bind the form to the table (or a query based on the query, which gives you more control over the order in which records are displayed) and simply navigate from record to record. Access does most of the "plumbing" for you, meaning that you should be able to get a working form up in a matter of minutes.
rkg
I've got thousands of records so I would like to have the user type in the ticket number she needs to edit then populate the form with with fields for editing. I have dBase set up so she can enter the ticket number then edit a ticket then answer yes or no if the info is correct, if it's correct it then asks if she would like to edit another ticket or return to the main menu. If she needs to edit another ticket it returns to the form for ticket number entry, then she can edit another ticket. I guess I would like to show only one record at a time.
Thanks,
Roon
Doug Steele
Try adding a combo box to the header of your form. The third option in the wizard should be something like "Find a record on my form based on the value I selected in my combo box". Let the wizard walk you through the steps, and you should be okay.
This is a "lo-fi" version of UA. To view the full version with more information, formatting and images, please click here.