editing data

ssh

Registered User.
Local time
Today, 12:51
Joined
May 22, 2002
Messages
49
How can I edit existing data through a form? When I enter a value to Catalogue # field (this is primary key field) then all related data should be visible (it means something autofill stuff) and no '...would create duplicate values...' messages. Any code part or can be simplier? Thanks.
 
You will not be able to type in a Catalogue # as this field is your Primary Key and Access is telling you that you cannot enter this number as it will create duplicate records.

What you will need to do is create an unbound combo box control for example (you can use the combo box wizard to do this).

From this list you will be able to search for a record and then make any updates you wish.

Basically this will search for a record and then allow you to change things (but not the Primart Key)

HTH

Post back if you need further help

Graham
 
I have tried this combo box version, won't work. What I want is all fields filled with data after entering a value in Catalogue # field and then edit them.
 
Using an unbound combo box will enable you to search and open the record at the correct one that you wish to edit.

You can then edit any information in that record (Excluding the Primary Key) and this will save to your tables.

HTH
 
Weird, no autofilling. Do I send you a sample of my database, Graham?
 
Yes, I selected third option and so on. When I typed something existing into that field nothing more happened, no autofill.
 
I ran into a situation where the wizard setup my combo box improperly. What I had done was made the form a data entry form. The wizard then did not code the AfterUpdate event of the combo box properly (it assumed since it was data entry that it did not need to). To bypass this, I just turned dataentry to False and told the form to go to a new record on open

DoCmd.GoToRecord ,,acNewRec
 
sending a sample

Here's a sample of my database. Try typing 33112-2 into Kataloogi # field (first and primary key field) and you see subform will be filled only and no other data. And how could I edit?
 

Attachments

ssh

As doulostheou mentions in the prior posting the form that you are using is set to be a Data Entry Only form.

Firstly change the property for Allow Data Entry to No

Go to the properties of the form Data Entry >> No

The field that you are specifying (i.e Kataloogi) is bound to your record source and is also your Primary Key. You can not use this field to search with.

  1. With the combo box wizard selected, add a new control to your form
  2. Select option 3 - Find a record on my form based on the value I selected in my combo box.
  3. Add Catalogue # field to Selected fields.
    [/list=1]
    This will now work and has been tested on your form.

    Please advise of package version in future (i.e. Access XP) as not all people have this running on their machines.

    HTH

    Graham
 
Now it works! Believe I had Data Entry set to Yes. so it didn't work. Thank you, Graham!
 

Users who are viewing this thread

Back
Top Bottom