Key database, need help with delete and add buttons

  • Thread starter Thread starter Gaubor
  • Start date Start date
G

Gaubor

Guest
Hello

I am planning a key database

I have planed to use access and visual basic.

VB to add and delete keys.

Access to do the rest.


Is this a good solution? Do you have a better one, pleas let me know.


I need help setting up the delete and add buttons, I am bad i vb.

And I need help with the Delivered button, when I push the button I want it to delete all the information on the page. But print a backup or save it as a file, do you have a good idea.

When I press the “add key button”, I want I to add a key.

If you have 3 keys, and press ADD key, then it adds a 4 key and it must be a scroll window. Then I can choose the key I gave him

There is a image of the plan I am having.
 

Attachments

  • Uten navn.JPG
    Uten navn.JPG
    33 KB · Views: 204
You can do this nearly automatically without any VB at all, or maybe only just a little bit.

Make a parent form that identifies the person and has all person-related info on it. Have an ID number as the Prime Key of the table driving the parent form.

Create a child table of keys, with the person's ID as a foreign key. Build a one-to-many relationship between person and keys. (Many keys, one person.)

Now build a form for the keys, one that looks like one line of a datasheet. Make it a sub-form of the parent form by building a sub-form control on the parent form. The relationship and the child form have to be defined already. The wizard will ask you the name of the field in the parent TABLE and the chile TABLE that are the linking fields. You would answer with the person's ID-number field names in the two tables.

Now you have the normal form navigation controls built in on the child form. You can press the >* button to add a record. You can select one of the records in the left margin and manually delete the record.

This is all automagic if you left the wizards enabled when you built the sub-form control and linked to the parent form and controls.
 
Relationships

I am running into a similar problem but I have no relationships. WHen I add in a delete button from access wizard, it only deletes the one entry but none of the other entries that depend on it. (one form is called Audit Info whch has client name and ID and the other is details, it only deltes the Audit Info entries but the Details entries are still in its respectable table). I tried adding relationships but it didn't work

Any help?
 

Users who are viewing this thread

Back
Top Bottom